aboutsummaryrefslogtreecommitdiff
path: root/src/connection.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-05 10:43:48 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-05 10:43:48 -0700
commit0478ad0c38d479b978d1a787cbcc090fab38a324 (patch)
tree9fefcc1b9dcbc12f2f91e16b6619bb6ebbdedd3b /src/connection.lisp
parent160b76c2bef0541ebcae3363ceebb0666e227451 (diff)
downloadconsfigurator-0478ad0c38d479b978d1a787cbcc090fab38a324.tar.gz
RUN and MRUN can now take lists of arguments
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection.lisp')
-rw-r--r--src/connection.lisp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index f839a65..96cf83e 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -181,8 +181,14 @@ the root Lisp's machine. For example, using rsync(1) over SSH."))
(:may-fail (setq may-fail t))
(:input (setq input (pop args)))
(:env (setq env (pop args)))
- (t (push (typecase arg (pathname (unix-namestring arg)) (t arg))
- cmd)))
+ (t (mapc (lambda (e)
+ (push (typecase e
+ (pathname
+ (unix-namestring e))
+ (t
+ e))
+ cmd))
+ (ensure-list arg))))
while args
finally (nreversef cmd))
(setq cmd (if (cdr cmd) (escape-sh-command cmd) (car cmd)))
@@ -205,6 +211,10 @@ specifying the shell command, with any necessary escaping already performed.
It is recommended that all keywords and corresponding values come first,
followed by argument(s) specifying the shell command to execute.
+You can additionally supply lists of arguments and these will be spliced into
+the resulting list of arguments to be passed to the command. I.e.
+(run \"a\" (list \"b\" \"c\")) is equivalent to (run \"a\" \"b\" \"c\").
+
Keyword arguments accepted:
- :FOR-EXIT / :MAY-FAIL -- don't signal an error condition if the command