]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34913: Document gzip command line interface (GH-9782)
authorStéphane Wirtel <stephane@wirtel.be>
Wed, 10 Oct 2018 06:28:26 +0000 (08:28 +0200)
committerJulien Palard <julien@palard.fr>
Wed, 10 Oct 2018 06:28:26 +0000 (08:28 +0200)
Doc/library/gzip.rst
Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst [new file with mode: 0644]

index 9c6b72237177d19e760b3c42d685711ce4b7c200..b52dd1a11aa9f9fdf74c352e9e5aea14aa756811 100644 (file)
@@ -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 (file)
index 0000000..e8a1176
--- /dev/null
@@ -0,0 +1 @@
+Add documentation about the new command line interface of the gzip module.