ambrevar/shell: Have `sh' and friends accept multiple arguments.

master
Pierre Neidhardt 2021-02-05 15:20:02 +01:00
parent 344c1d78a6
commit 09a594a8fd
1 changed files with 10 additions and 9 deletions

View File

@ -104,19 +104,20 @@ Also see `*shell-command-flags*'.")
*shell* *shell-command-flag* shell-command)) *shell* *shell-command-flag* shell-command))
(export-always 'sh) (export-always 'sh)
(defun sh (shell-command) (defun sh (&rest shell-args)
"Wrapper around `cmd:cmd' to execute SHELL-COMMAND in `*shell*'." "Wrapper around `cmd:cmd' to execute SHELL-COMMAND in `*shell*'.
(cmd:cmd (format-shell-command shell-command))) SHELL-ARGS are strings that are concatenated before being sent to the shell."
(cmd:cmd (format-shell-command (str:join "" shell-args))))
(export-always 'sh&) (export-always 'sh&)
(defun sh& (shell-command) (defun sh& (&rest shell-args)
"Wrapper around `cmd:cmd&' to execute SHELL-COMMAND in `*shell*'." "Same as `sh' but around `cmd:cmd&'"
(cmd:cmd& (format-shell-command shell-command))) (cmd:cmd& (format-shell-command (str:join "" shell-args))))
(export-always '$sh) (export-always '$sh)
(defun $sh (shell-command) (defun $sh (&rest shell-args)
"Wrapper around `cmd:$cmd' to execute SHELL-COMMAND in `*shell*'." "Same as `sh' but around `cmd:$cmd'"
(cmd:$cmd (format-shell-command shell-command))) (cmd:$cmd (format-shell-command (str:join "" shell-args))))
(export-always 'cmd&) (export-always 'cmd&)
(defun cmd& (cmd) ; TODO: Support (cmd &rest args) lambda list. (defun cmd& (cmd) ; TODO: Support (cmd &rest args) lambda list.