summaryrefslogtreecommitdiffstats
path: root/Doc/library/shlex.rst
diff options
context:
space:
mode:
authorBo Bayles <bbayles@gmail.com>2019-05-29 08:06:12 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2019-05-29 08:06:11 (GMT)
commitca804955927dddb6ae5a846dbc0248a932be9a4e (patch)
treed9cb8069d21b991842d1210e1641a95ebddde912 /Doc/library/shlex.rst
parentf83d1dbd3bfbde940117c85f5c70de00e47b7e6e (diff)
downloadcpython-ca804955927dddb6ae5a846dbc0248a932be9a4e.zip
cpython-ca804955927dddb6ae5a846dbc0248a932be9a4e.tar.gz
cpython-ca804955927dddb6ae5a846dbc0248a932be9a4e.tar.bz2
bpo-22454: Add shlex.join() (the opposite of shlex.split()) (GH-7605)
Diffstat (limited to 'Doc/library/shlex.rst')
-rw-r--r--Doc/library/shlex.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst
index fb335c6..8c5b023 100644
--- a/Doc/library/shlex.rst
+++ b/Doc/library/shlex.rst
@@ -37,6 +37,21 @@ The :mod:`shlex` module defines the following functions:
standard input.
+.. function:: join(split_command)
+
+ Concatenate the tokens of the list *split_command* and return a string.
+ This function is the inverse of :func:`split`.
+
+ >>> from shlex import join
+ >>> print(join(['echo', '-n', 'Multiple words']))
+ echo -n 'Multiple words'
+
+ The returned value is shell-escaped to protect against injection
+ vulnerabilities (see :func:`quote`).
+
+ .. versionadded:: 3.8
+
+
.. function:: quote(s)
Return a shell-escaped version of the string *s*. The returned value is a