(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)))))))