X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=candle;a=blobdiff_plain;f=src%2Fmain%2Fcli.lisp;h=75ecd40b3af6b6c15eb5fe7527e1abd7d80b36f4;hp=1fff398fd28aabb595e8c495be6e78e5ba71c58d;hb=5c21748c18e32bb9fe17bb4c23329be02edc23a2;hpb=ec3c4dac8416e025e186501842723852b16cab4e diff --git a/src/main/cli.lisp b/src/main/cli.lisp index 1fff398..75ecd40 100644 --- a/src/main/cli.lisp +++ b/src/main/cli.lisp @@ -269,6 +269,17 @@ (defmethod execute-command ((command (eql :run)) args) (let - ((options '((:name :help :short "h" :long "help" :description "Print this usage.")))) - (standard-cli "run" options args :default nil - (when (not (candle:run)) (sb-ext:exit :code 1))))) + ((options + '((:name :help :short "h" :long "help" :description "Print this usage.") + (:name :task :long "task" :variable-name "TASK" :takes-argument t :description "Run TASK")))) + (standard-cli "candle run" options args :default nil + (cond + ((opera:option-present :task parsed-options) + (let + ((tasks (candle:list-tasks)) + (specified-task (intern (string-upcase (opera:option-argument :task parsed-options)) :keyword))) + (if + (not (find specified-task (candle:list-tasks))) + (error-and-exit "Task ~(~A~) does not exist in .candle file" specified-task) + (candle:run specified-task)))) + (t (when (not (candle:run)) (sb-ext:exit :code 1)))))))