summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Wirtel <stephane@wirtel.be>2018-10-10 08:28:26 +0200
committerJulien Palard <julien@palard.fr>2018-10-10 08:28:26 +0200
commit7c817e620be9013466d4dd008a2f1dbffcf7517e (patch)
tree773f0a3081eb04f601e5a8fba5eb48b730e26000
parente8bbc52debfd1b28517946d65db257e6b6d92e29 (diff)
downloadcpython-git-7c817e620be9013466d4dd008a2f1dbffcf7517e.tar.gz
bpo-34913: Document gzip command line interface (GH-9782)
-rw-r--r--Doc/library/gzip.rst35
-rw-r--r--Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst1
2 files changed, 36 insertions, 0 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 9c6b722371..b52dd1a11a 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -211,3 +211,38 @@ Example of how to GZIP compress a binary string::
The basic data compression module needed to support the :program:`gzip` file
format.
+Command Line Interface
+----------------------
+
+The :mod:`gzip` module provides a simple command line interface to compress or
+decompress files.
+
+Once executed the :mod:`gzip` module keeps the input file(s).
+
+.. versionchanged:: 3.8
+
+ Add a new command line interface with a usage.
+
+Command line options
+^^^^^^^^^^^^^^^^^^^^
+
+.. cmdoption:: file
+
+ .. code-block:: shell-session
+
+ $ python -m gzip file
+
+ If *file* is not specified, read from :attr:`sys.stdin`.
+
+.. cmdoption:: -d, --decompress
+
+ Decompress the given file
+
+ .. code-block:: shell-session
+
+ $ python -m gzip -d file.gz
+
+.. cmdoption:: -h, --help
+
+ Show the help message.
+
diff --git a/Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst b/Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst
new file mode 100644
index 0000000000..e8a1176147
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst
@@ -0,0 +1 @@
+Add documentation about the new command line interface of the gzip module.