From 9068e2f23ccd9fa500ec6f332d5e379c350fa198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Wirtel?= Date: Wed, 10 Oct 2018 00:58:35 +0200 Subject: [PATCH 1/3] bpo-34913: Document gzip command line interface --- Doc/library/gzip.rst | 35 +++++++++++++++++++ .../2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst | 1 + 2 files changed, 36 insertions(+) create mode 100644 Misc/NEWS.d/next/Documentation/2018-10-10-00-34-08.bpo-34913.kVd1Fv.rst diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index 9c6b72237177d1..f7d87e11eef703 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 +uncompress files. + +Once executed the :mod:`gzip` module keeps the input file(s). + +.. versionadded:: 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 + + Uncompress 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 00000000000000..e8a11761477c8c --- /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. From 388480f30159641927aa8104b95e7d3166c99927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Wirtel?= Date: Wed, 10 Oct 2018 07:47:36 +0200 Subject: [PATCH 2/3] Replace uncompress by the used word 'decompress' --- Doc/library/gzip.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index f7d87e11eef703..881d89cdd9a397 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -215,7 +215,7 @@ Command Line Interface ---------------------- The :mod:`gzip` module provides a simple command line interface to compress or -uncompress files. +decompress files. Once executed the :mod:`gzip` module keeps the input file(s). @@ -236,7 +236,7 @@ Command line options .. cmdoption:: -d, --decompress - Uncompress the given file + Decompress the given file .. code-block:: shell-session From 4a977e9fed2dc9404a1e4ea46be3db5042a7ab2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Wirtel?= Date: Wed, 10 Oct 2018 07:48:03 +0200 Subject: [PATCH 3/3] the CLI has been changed in 3.8, not added --- Doc/library/gzip.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst index 881d89cdd9a397..b52dd1a11aa9f9 100644 --- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -219,7 +219,7 @@ decompress files. Once executed the :mod:`gzip` module keeps the input file(s). -.. versionadded:: 3.8 +.. versionchanged:: 3.8 Add a new command line interface with a usage.