diff options
author | Colin Okay <okay@toyful.space> | 2022-02-22 18:45:00 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-22 18:45:00 -0600 |
commit | 7f3b1cb6946cff68c9006c2694adac631f12f623 (patch) | |
tree | e89db6e362ff4f4b428b417d153f1d16b71dd5e7 /src | |
parent | 379480e6af030dee3d225fa4f76735fa43db36de (diff) |
added print explanation
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.lisp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib.lisp b/src/lib.lisp index 147e294..680e93a 100644 --- a/src/lib.lisp +++ b/src/lib.lisp @@ -93,12 +93,16 @@ the directories that appear in the value of that variable." (defun tags-from-oneliner (oneliner) (remove-if-not #'executable-on-system-p (ppcre:split " +" oneliner))) + + +(rl:register-hook :signal (lambda () (uiop:quit))) + (defun prompt (prompt &key (expect (constantly t)) retry-text (prefill "")) - ;; register a prefil hook + ;; register a prefill hook (rl:register-hook :pre-input (lambda () @@ -135,6 +139,12 @@ the directories that appear in the value of that variable." ;;; API REQUEST FUNCTIONS +(defun print-item-explanation (number) + (with-cached-result (ol number) + (when (getf ol :explanation) + (princ #\newline) + (princ (getf ol :explanation))))) + (defun flag-item (item-number) (with-cached-result (ol item-number) (ensure-config) @@ -250,7 +260,8 @@ the directories that appear in the value of that variable." :prefill "auto"))) (explanation (when (y-or-n-p "Provide an explanation?") - (string-from-editor)))) + (string-from-editor + (format nil "~a~%~%" oneliner))))) (api:request-with (:host (host) :body (jonathan:to-json |