From 7f3b1cb6946cff68c9006c2694adac631f12f623 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 22 Feb 2022 18:45:00 -0600 Subject: added print explanation --- src/lib.lisp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/lib.lisp') 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 -- cgit v1.2.3