aboutsummaryrefslogtreecommitdiff
path: root/app/run.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-08-05 09:50:42 -0500
committerColin Okay <colin@cicadas.surf>2022-08-05 09:50:42 -0500
commit9a9f629068b4ffe7173bc92f12080685743dc6ab (patch)
treed62379dc9eabadfc6c7c0f907e16894511376c00 /app/run.lisp
parentf116178dcf8b450c76400e2a0fbd2991f2c227b4 (diff)
[add] defhandler macro for app package.
Diffstat (limited to 'app/run.lisp')
-rw-r--r--app/run.lisp13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/run.lisp b/app/run.lisp
index 987ecad..556b719 100644
--- a/app/run.lisp
+++ b/app/run.lisp
@@ -24,14 +24,11 @@
:key :confirm
:description "prompts the user for confirmation before running the command")))
-(defun run/handler (cmd)
- (a:if-let (args (cli:command-arguments cmd))
- (ol::run-item
- (first args) (rest args)
- :verbose (cli:getopt cmd :verbose)
- :confirm (cli:getopt cmd :confirm)
- :timeout (cli:getopt cmd :timeout))
- (cli:print-usage-and-exit cmd t)))
+(defhandler run/handler (id . args)
+ (ol:run-item (parse-identifier id) args
+ :verbose (cli:getopt *cmd* :verbose)
+ :confirm (cli:getopt *cmd* :confirm)
+ :timeout (cli:getopt *cmd* :timeout)))
(defparameter +run/examples+
'(("Run a hypothetical command called echo-stuff with positional arguments" .