Skip to content

Commit 7c817e6

Browse files
matrixiseJulienPalard
authored andcommitted
bpo-34913: Document gzip command line interface (GH-9782)
1 parent e8bbc52 commit 7c817e6

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Doc/library/gzip.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,38 @@ Example of how to GZIP compress a binary string::
211211
The basic data compression module needed to support the :program:`gzip` file
212212
format.
213213

214+
Command Line Interface
215+
----------------------
216+
217+
The :mod:`gzip` module provides a simple command line interface to compress or
218+
decompress files.
219+
220+
Once executed the :mod:`gzip` module keeps the input file(s).
221+
222+
.. versionchanged:: 3.8
223+
224+
Add a new command line interface with a usage.
225+
226+
Command line options
227+
^^^^^^^^^^^^^^^^^^^^
228+
229+
.. cmdoption:: file
230+
231+
.. code-block:: shell-session
232+
233+
$ python -m gzip file
234+
235+
If *file* is not specified, read from :attr:`sys.stdin`.
236+
237+
.. cmdoption:: -d, --decompress
238+
239+
Decompress the given file
240+
241+
.. code-block:: shell-session
242+
243+
$ python -m gzip -d file.gz
244+
245+
.. cmdoption:: -h, --help
246+
247+
Show the help message.
248+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add documentation about the new command line interface of the gzip module.

0 commit comments

Comments
 (0)