Metadata-Version: 2.4
Name: cs-sh
Version: 20260912.1
Summary: Convenience functions for constructing shell commands.
Keywords: python2,python3
Author-email: Cameron Simpson <cs@cskk.id.au>
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Project-URL: MonoRepo Commits, https://bitbucket.org/cameron_simpson/css/commits/branch/main
Project-URL: Monorepo Git Mirror, https://github.com/cameron-simpson/css
Project-URL: Monorepo Hg/Mercurial Mirror, https://hg.sr.ht/~cameron-simpson/css
Project-URL: Source, https://github.com/cameron-simpson/css/blob/main/lib/python/cs/sh.py

Convenience functions for constructing shell commands.

*Latest release 20260912.1*:
Fix project specification.

Functions for safely constructing shell command lines from bare strings.
Somewhat like the inverse of the shlex stdlib module.

As of Python 3.3 the function `shlex.quote()` does what `quotestr()` does.

As of Python 3.8 the function `shlex.join()` does what `quoteargv()` does.



Short summary:


* `main_shqstr`: shqstr: emit shell-quoted form of the command line arguments.


* `quote`: Quote the supplied strings, return a list of the quoted strings.


* `quoteargv`: Quote strings, assemble into command string.


* `quotestr`: Quote a string for use on a shell command line.

# Functions

## main_shqstr(argv=None)

shqstr: emit shell-quoted form of the command line arguments.

## quote(args)

Quote the supplied strings, return a list of the quoted strings.

As of Python 3.8 the function `shlex.join()` probably does
what you would have done with the result of this function
i.e. join the resulting strings together.

## quoteargv(argv)

Quote strings, assemble into command string.

## quotestr(s)

Quote a string for use on a shell command line.

As of Python 3.3 the function `shlex.quote()` is available for this.

# Release Log



*Release 20260912.1*:
Fix project specification.

*Release 20260912*:
Rename quotecmd to quoteargv.

*Release 20210316*:
Minor doc update.

*Release 20180613*:
Rework quotestr significantly to provide somewhat friendlier quoting, include "," in the SAFECHARS.

*Release 20170903.2*:
bugfix __main__ boilerplate after setuptools workaround

*Release 20170903.1*:
workaround setuptool's slightly dumb console_scripts call of a "main" function

*Release 20170903*:
shqstr command; new quotecmd(argv) function

*Release 20150118*:
Extend SAFECHARS to include colon.

*Release 20150111*:
minor cleanup

*Release 20150107*:
initial standalone public release
