diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-05 09:50:42 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-05 09:50:42 -0500 |
commit | 9a9f629068b4ffe7173bc92f12080685743dc6ab (patch) | |
tree | d62379dc9eabadfc6c7c0f907e16894511376c00 /app/run.lisp | |
parent | f116178dcf8b450c76400e2a0fbd2991f2c227b4 (diff) |
[add] defhandler macro for app package.
Diffstat (limited to 'app/run.lisp')
-rw-r--r-- | app/run.lisp | 13 |
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" . |