aboutsummaryrefslogtreecommitdiff
path: root/build-app.lisp
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-03-04 14:25:20 -0600
committerColin Okay <okay@toyful.space>2022-03-04 14:25:20 -0600
commita9631a594c1c449b4125d591ae4538fdc4705159 (patch)
treebad8dbcbf089f765a511eec1976e9ac047352b13 /build-app.lisp
parent22ee290ca7a7b625fa9f1a1bb420a08fc94e51a7 (diff)
changed help to alter arguments interpretation
Diffstat (limited to 'build-app.lisp')
-rw-r--r--build-app.lisp24
1 files changed, 20 insertions, 4 deletions
diff --git a/build-app.lisp b/build-app.lisp
index 044ae8a..ca1c83f 100644
--- a/build-app.lisp
+++ b/build-app.lisp
@@ -58,6 +58,18 @@ Finally, you can MIX POSITIONAL AND NAMED VARIABLES so long as, when
you run the oneliner, all positional variables appear first.
")
+(defparameter +configure-your-edtior+
+ "Adding explainations for oneliners, either with --add or --edit,
+will use a default system editor. If you do not like the default
+editor you may configure it by the exporting the EDITOR environment
+variable to whatever you prefer.
+
+E.g. in your .bashrc you might put
+
+export EDITOR=/usr/bin/zile
+
+")
+
;;; CLON SYNOPSIS DEFINITION
@@ -104,10 +116,12 @@ you run the oneliner, all positional variables appear first.
(flag :long-name "whois"
:description "View information about a contributor. The first argument is a contributor handle.")
(flag :long-name "help"
- :description "Print help for a topic. Topics: wiki, account, invites, variables"))
+ :description "Print help for a topic. Topics: wiki, account, invites, variables, editor"))
(group (:header "Advanced Options" :hidden t)
(flag :long-name "clear-cache"
:description "Clears all cached search results from your system."))
+ (group (:header "Editor" :hidden t)
+ (text :contents +configure-your-edtior+))
(group (:header "Variables" :hidden t)
(text :contents +oneliners-variables-help-text+))
(group (:header "Wiki" :hidden t)
@@ -169,12 +183,14 @@ than the users."
(defun main ()
"Entry point for our standalone application."
(make-context)
- (a:when-let (topic (getopt :long-name "help"))
- (help :item (find-group-with-header (symbol-name topic)))
- (uiop:quit))
(handler-case
(let ((arguments (remainder)))
(cond
+ ((getopt :long-name "help")
+ (if (and arguments (find-group-with-header (first arguments)))
+ (help :item (find-group-with-header (first arguments)))
+ (help))
+ (uiop:quit))
((getopt :long-name "whois")
(assert (first arguments) () "--whois requires an argument, a user handle.")
(cli::show-contributor (first arguments)))