aboutsummaryrefslogtreecommitdiff
path: root/lib/client.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/client.lisp')
-rw-r--r--lib/client.lisp21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/client.lisp b/lib/client.lisp
index 8a8c4be..e6324aa 100644
--- a/lib/client.lisp
+++ b/lib/client.lisp
@@ -176,11 +176,7 @@ running the body. If such a oneliner can be found."
(ppcre:split " +"
(prompt "More tags here, or Enter to skip: ")))))
(runstyle
- (string-upcase
- (prompt "Runstyle (auto or manual): "
- :expect 'valid-runstyle-p
- :retry-text "Must be (auto or manual): "
- :prefill "auto")))
+ (infer-runstyle))
(explanation
(when (y-or-n-p "Provide an explanation?")
(string-from-editor
@@ -197,6 +193,15 @@ running the body. If such a oneliner can be found."
(put-draft draft-name local)
(format t "Saved draft ~a~%" draft-name)))))
+(defun infer-runstyle ()
+ (if (or
+ (y-or-n-p "Will this command require user input?")
+ (y-or-n-p "Or invoke a GUI or TUI?")
+ (y-or-n-p "Will it require access to the shell history?"))
+ "MANUAL"
+ "AUTO"))
+
+
;;; EDITING ONELINERS
(defun edit-item (ident &optional draftp)
@@ -242,11 +247,7 @@ running the body. If such a oneliner can be found."
init-tags
:test 'equal)))))))
(runstyle
- (string-upcase
- (prompt "Runstyle (auto or manual): "
- :expect 'valid-runstyle-p
- :retry-text "Must be (auto or manual): "
- :prefill (oneliner-runstyle ol))))
+ (infer-runstyle))
(explanation
(when (y-or-n-p "Alter the explanation?")