X-Git-Url: https://code.consxy.com/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fcli.lisp;h=d0a5c2157989c189ca02c4d5de3d67d56bd30783;hb=124e400cd0be0e884d0cb7ea400899b3288c1fc0;hp=8afc8403111cedf3a474fa72ed4cb23b19e581fb;hpb=9407d49f19966b27a3a0d891d65024e547024d76;p=candle diff --git a/src/main/cli.lisp b/src/main/cli.lisp index 8afc840..d0a5c21 100644 --- a/src/main/cli.lisp +++ b/src/main/cli.lisp @@ -8,7 +8,7 @@ (defun job-info->line (job-info) (format nil "~A (~A) ~A" (subseq (first job-info) 0 8) - (format nil "~{~A/~A/~A ~A:~A~}" + (format nil "~{~2,,,'0@A/~2,,,'0@A/~A ~2,,,'0@A:~2,,,'0@A~}" (utils:time-as-list (third job-info) :month :date :year :hr :min)) (case (second job-info) (:succeeded (format nil "~c[1;32mPassed~c[0m" #\Esc #\Esc)) @@ -72,6 +72,7 @@ (:show (show-project (cdr remaining-args))) (:refresh (refresh-project (cdr remaining-args))) (:list (list-projects)) + (:failures (project-failures (cdr remaining-args))) (t (project-usage)))))))) (defun project-usage () @@ -173,6 +174,22 @@ (defun list-projects () (format t "~{~{~A ~A~}~%~}" (communication:query `(candle:list-projects)))) +(defun project-failures (args) + (let* + ((options + '((:name :help :short "h" :long "help" :description "Print this usage.") + (:name :project :long "project" :variable-name "PROJECT" :takes-argument t :description "Restrict failures to project named by PROJECT"))) + (usage (opera:usage "candle project failures" options))) + (multiple-value-bind (options remaining-args error) (opera:process-arguments options args) + (cond + ((eql error :unknown-option) (format *error-output* "Unknown option: ~A. See 'candle project failures --help'.~%" (car remaining-args))) + ((eql error :required-argument-missing) (format *error-output* "Missing argument for ~A. See 'candle project failures --help'.~%" (car remaining-args))) + ((opera:option-present :help options) (format t "~A" usage)) + (t + (format t "~A" + (communication:query + `(candle:failures ,(when (opera:option-present :project options) (opera:option-argument :project options)))))))))) + ;;; Section for ./candle job (defmethod execute-command ((command (eql :job)) args)