diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-05 08:58:35 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-05 08:58:35 -0500 |
commit | f116178dcf8b450c76400e2a0fbd2991f2c227b4 (patch) | |
tree | 67fcc6a6e7035eb0b1929e495bceca2dc4fa564b /app/run.lisp | |
parent | 5c590a614544c977964692e41b0e5c19043b142c (diff) |
[wip] [refactor] [add] subcommands.
Diffstat (limited to 'app/run.lisp')
-rw-r--r-- | app/run.lisp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/app/run.lisp b/app/run.lisp index 2591927..987ecad 100644 --- a/app/run.lisp +++ b/app/run.lisp @@ -24,13 +24,27 @@ :key :confirm :description "prompts the user for confirmation before running the command"))) -(defun run/handler (cmd)) +(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))) (defparameter +run/examples+ - '(())) - + '(("Run a hypothetical command called echo-stuff with positional arguments" . + "ol run echo-stuff one two three") + ("Run a hypothetical command with id 341 with a timeout and confirmation" . + "ol run -c -t 10 341"))) (defun run/command () (cli:make-command :name "run" - :description "")) + :usage "<IDENTIFIER> [ARG ...]" + :description "run the identified oneliner with any arguments it might take" + :options (run/options) + :handler #'run/handler + :examples +run/examples+)) + |