Commit 28e7b510 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

Rename shell-split-string to split-string-shell-command

* lisp/shell.el (split-string-shell-command):
* doc/lispref/processes.texi (Shell Arguments): Rename from
parent 4fb6cf3f
Pipeline #11413 failed with stages
in 59 seconds
......@@ -247,12 +247,12 @@ protected by @code{shell-quote-argument};
@code{combine-and-quote-strings} is @emph{not} intended to protect
special characters from shell evaluation.
@defun shell-split-string string
@defun split-string-shell-command string
This function splits @var{string} into substrings, respecting double
and single quotes, as well as backslash quoting.
(shell-split-string "ls /tmp/'foo bar'")
(split-string-shell-command "ls /tmp/'foo bar'")
@result{} ("ls" "/tmp/foo bar")
@end smallexample
@end defun
......@@ -2971,7 +2971,7 @@ The former is now declared obsolete.
* Lisp Changes in Emacs 28.1
*** New function 'shell-split-string'.
*** New function 'split-string-shell-command'.
This splits a shell string into separate components, respecting single
and double quotes, as well as backslash quoting.
......@@ -459,7 +459,7 @@ Useful for shells like zsh that has this feature."
(push (mapconcat #'identity (nreverse arg) "") args)))
(cons (nreverse args) (nreverse begins)))))
(defun shell-split-string (string)
(defun split-string-shell-command (string)
"Split STRING (a shell command) into a list of strings.
General shell syntax, like single and double quoting, as well as
backslash quoting, is respected."
......@@ -46,17 +46,17 @@
'(("cd" "ba" "") 1 4 7)))))
(ert-deftest shell-tests-split-string ()
(should (equal (shell-split-string "ls /tmp")
(should (equal (split-string-shell-command "ls /tmp")
'("ls" "/tmp")))
(should (equal (shell-split-string "ls '/tmp/foo bar'")
(should (equal (split-string-shell-command "ls '/tmp/foo bar'")
'("ls" "/tmp/foo bar")))
(should (equal (shell-split-string "ls \"/tmp/foo bar\"")
(should (equal (split-string-shell-command "ls \"/tmp/foo bar\"")
'("ls" "/tmp/foo bar")))
(should (equal (shell-split-string "ls /tmp/'foo bar'")
(should (equal (split-string-shell-command "ls /tmp/'foo bar'")
'("ls" "/tmp/foo bar")))
(should (equal (shell-split-string "ls /tmp/'foo\\ bar'")
(should (equal (split-string-shell-command "ls /tmp/'foo\\ bar'")
'("ls" "/tmp/foo\\ bar")))
(should (equal (shell-split-string "ls /tmp/foo\\ bar")
(should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
'("ls" "/tmp/foo bar"))))
;;; shell-tests.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment