From 9a9f629068b4ffe7173bc92f12080685743dc6ab Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 5 Aug 2022 09:50:42 -0500 Subject: [add] defhandler macro for app package. --- app/run.lisp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'app/run.lisp') 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" . -- cgit v1.2.3