Add project adds to server
[candle] / src / main / cli.lisp
index bbbf23cdffe28945754d57739af5d6257dad80ad..fc3f7fc9ece28ef0f0f6f9ec77b95252c1b91a6b 100644 (file)
@@ -29,7 +29,8 @@
    (main-options)
    "Interacts with candle server.  The available commands are:
   project   List, show or add projects
-  job       List or show jobs")))
+  job       List or show jobs
+  run       Local command.  Run candle in the current working directory")))
 
 (defgeneric execute-command (command args))
 
@@ -45,6 +46,7 @@
     (let*
      ((name (subseq project-definition 0 pos))
       (src (subseq project-definition (1+ pos))))
+     (communication:query `(candle:add-project ,name ,src))
      (format t "Added project ~A at src definition ~A~%" name src))))))
 
 (defmethod execute-command ((command (eql :project)) args)
@@ -78,7 +80,7 @@
    ((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))))
-   (t (candle:run)))))
+   ((not (candle:run)) (sb-ext:exit :code 1)))))
 
 (defun run ()
  (multiple-value-bind (options remaining-args error) (opera:process-arguments (main-options) (cdr sb-ext:*posix-argv*))