- ((opera:option-present :help options) (format t "~A" (opera:usage "candle job" (job-options))))
- ((and (opera:option-present :add options) (not (opera:option-present :project-name options)))
- (format *error-output* "Cannot --add without --project. See 'candle job --help'.~%"))
- ((opera:option-present :add options)
- (add-job
- (opera:option-argument :project-name options)
- (opera:option-argument :add options))))))
+ ((opera:option-present :help options) (format t "~A" (opera:usage "candle job" (job-options)))))))
+
+(defmethod execute-command ((command (eql :run)) args)
+ (multiple-value-bind (options remaining-args error) (opera:process-arguments (run-options) args)
+ (cond
+ ((eql error :unknown-option) (format *error-output* "Unknown option: ~A. See 'candle run --help'.~%" (car remaining-args)))
+ ((eql error :required-argument-missing) (format *error-output* "Missing argument for ~A. See 'candle run --help'.~%" (car remaining-args)))
+ (remaining-args (format *error-output* "Unknown option: ~A. See 'candle run --help'.~%" (car remaining-args)))
+ ((opera:option-present :help options) (format t "~A" (opera:usage "candle run" (run-options))))
+ ((not (candle:run)) (sb-ext:exit :code 1)))))