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))
(export-always 'sh)
(defun sh (shell-command)
"Wrapper around `cmd:cmd' to execute SHELL-COMMAND in `*shell*'."
(cmd:cmd (format-shell-command shell-command)))
(defun sh (&rest shell-args)
"Wrapper around `cmd:cmd' to execute SHELL-COMMAND in `*shell*'.
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&)
(defun sh& (shell-command)
"Wrapper around `cmd:cmd&' to execute SHELL-COMMAND in `*shell*'."
(cmd:cmd& (format-shell-command shell-command)))
(defun sh& (&rest shell-args)
"Same as `sh' but around `cmd:cmd&'"
(cmd:cmd& (format-shell-command (str:join "" shell-args))))
(export-always '$sh)
(defun $sh (shell-command)
"Wrapper around `cmd:$cmd' to execute SHELL-COMMAND in `*shell*'."
(cmd:$cmd (format-shell-command shell-command)))
(defun $sh (&rest shell-args)
"Same as `sh' but around `cmd:$cmd'"
(cmd:$cmd (format-shell-command (str:join "" shell-args))))
(export-always 'cmd&)
(defun cmd& (cmd) ; TODO: Support (cmd &rest args) lambda list.