diff options
Diffstat (limited to 'lib/oneliner.lisp')
-rw-r--r-- | lib/oneliner.lisp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/lib/oneliner.lisp b/lib/oneliner.lisp index 39aad0d..4828b2d 100644 --- a/lib/oneliner.lisp +++ b/lib/oneliner.lisp @@ -18,7 +18,7 @@ (in-package :oneliners.cli) -(defstruct oneliner +(defplist oneliner id name oneliner @@ -78,22 +78,19 @@ (concatenate 'string "~" (prin1-to-string *term-width*) "<~a~;by ~a~>~%"))) (loop repeat *term-width* do (princ #\_)) (terpri) - (with-slots - (id name isflagged islocked runstyle tags createdby brief oneliner) ol - - (format t title-line-format-str - id - (or name " ") - (format nil "~:[ ~;⚠~]~:[ ~;🔒~]~:[ ~;📋~]" - isflagged - islocked - (equalp "manual" runstyle))) - (format t tags-line-format-string - (format nil "tags: ~{~a~^ ~}" tags) - createdby) - (loop - for x from 0 to (length brief) by *term-width* - do (format t "~a~%" - (string-trim '(#\space) - (alexandria-2:subseq* brief x (+ x *term-width*))))) - (format t "~%~a~%~%" oneliner)))) + (format t title-line-format-str + (oneliner-id ol) + (or (oneliner-name ol) " ") + (format nil "~:[ ~;⚠~]~:[ ~;🔒~]~:[ ~;📋~]" + (oneliner-isflagged ol) + (oneliner-islocked ol) + (equalp "manual" (oneliner-runstyle ol)))) + (format t tags-line-format-string + (format nil "tags: ~{~a~^ ~}" (oneliner-tags ol)) + (oneliner-createdby ol)) + (loop + for x from 0 to (length (oneliner-brief ol)) by *term-width* + do (format t "~a~%" + (string-trim '(#\space) + (alexandria-2:subseq* (oneliner-brief ol) x (+ x *term-width*))))) + (format t "~%~a~%~%" (oneliner-oneliner ol)))) |