]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #28513: Documented command-line interface of zipfile.
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 2 Nov 2016 10:13:48 +0000 (12:13 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 2 Nov 2016 10:13:48 +0000 (12:13 +0200)
1  2 
Doc/library/zipfile.rst
Misc/NEWS

index 47ba0b521e1ddc9e7cda7be7877c96e7338a6040,905648914b37570a7e5c6ae387a2d25c91e8e5d3..97d31d94830cff84d67ff23a0c24a7053f92116f
@@@ -632,4 -632,60 +632,64 @@@ Instances have the following methods an
     Size of the uncompressed file.
  
  
+ .. _zipfile-commandline:
+ .. program:: zipfile
+ Command-Line Interface
+ ----------------------
+ The :mod:`zipfile` module provides a simple command-line interface to interact
+ with ZIP archives.
+ If you want to create a new ZIP archive, specify its name after the :option:`-c`
+ option and then list the filename(s) that should be included:
+ .. code-block:: shell-session
+     $ python -m zipfile -c monty.zip spam.txt eggs.txt
+ Passing a directory is also acceptable:
+ .. code-block:: shell-session
+     $ python -m zipfile -c monty.zip life-of-brian_1979/
+ If you want to extract a ZIP archive into the specified directory, use
+ the :option:`-e` option:
+ .. code-block:: shell-session
+     $ python -m zipfile -e monty.zip target-dir/
+ For a list of the files in a ZIP archive, use the :option:`-l` option:
+ .. code-block:: shell-session
+     $ python -m zipfile -l monty.zip
+ Command-line options
+ ~~~~~~~~~~~~~~~~~~~~
+ .. cmdoption:: -l <zipfile>
++               --list <zipfile>
+    List files in a zipfile.
+ .. cmdoption:: -c <zipfile> <source1> ... <sourceN>
++               --create <zipfile> <source1> ... <sourceN>
+    Create zipfile from source files.
+ .. cmdoption:: -e <zipfile> <output_dir>
++               --extract <zipfile> <output_dir>
+    Extract zipfile into target directory.
+ .. cmdoption:: -t <zipfile>
++               --test <zipfile>
+    Test whether the zipfile is valid or not.
  .. _PKZIP Application Note: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
diff --cc Misc/NEWS
index a58b2089604d0b77172a0117496a1e7ba19e276c,7c76d7511800884ef95be33727393cbc8d534a62..c1ec9dca843e127f31cc42ec92cf32df15f6eefc
+++ b/Misc/NEWS
@@@ -374,6 -404,6 +374,11 @@@ C AP
    PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
    PyUnicode_AsEncodedUnicode().
  
++Documentation
++-------------
++
++- Issue #28513: Documented command-line interface of zipfile.
++
  Build
  -----