Commits (2)
......@@ -2,7 +2,7 @@
(defsystem "inferior-shell"
:description "spawn local or remote processes and shell pipes"
:version "2.0.2"
:version "2.0.3"
:defsystem-depends-on (:asdf #-asdf3 "uiop")
:depends-on ((:version #+asdf3 "asdf" #-asdf3 "uiop" "3.0.3") ; input and error-output redirection
#+sbcl "sb-posix"
......@@ -174,25 +174,23 @@
(clps-current-argument c) nil)))
(defun parse-process-spec (spec)
(macrolet ((make-sequence-instance (spec-type args)
',spec-type :processes
(loop :for process :in (mapcar 'parse-process-spec ,args)
:nconc (etypecase process
(,spec-type (sequence-processes process))
(sequence-spec (list process))
(command-spec (list process)))))))
(labels ((make-sequence-instance (spec-type args)
(make-instance spec-type :processes
(loop :for process :in (mapcar 'parse-process-spec args)
:nconc (if (typep process spec-type)
(sequence-processes process)
(list process))))))
(match spec
(`(pipe ,@args)
(make-sequence-instance pipe-spec args))
(make-sequence-instance 'pipe-spec args))
(`(or ,@args)
(make-sequence-instance or-spec args))
(make-sequence-instance 'or-spec args))
(`(and ,@args)
(make-sequence-instance and-spec args))
(make-sequence-instance 'and-spec args))
(`(progn ,@args)
(make-sequence-instance progn-spec args))
(make-sequence-instance 'progn-spec args))
(`(fork ,@args)
(make-sequence-instance fork-spec args))
(make-sequence-instance 'fork-spec args))
(`(,_ ,@_)
(let ((c (make-instance 'command-parse)))
(dolist (elem spec)
......@@ -55,7 +55,7 @@
&key time show host (on-error t)
"run command CMD"
(when (eq on-error t) (setf on-error 'signal))
(when (eq on-error t) (setf on-error 'error))
(when show
(format *trace-output* "; ~A~%" (print-process-spec cmd)))
(flet ((run-it ()