From: Serhiy Storchaka Date: Wed, 2 Nov 2016 10:13:48 +0000 (+0200) Subject: Issue #28513: Documented command-line interface of zipfile. X-Git-Tag: v3.7.0a1~2076 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a97bf7decafd3421c91565bc2f16e7b1992b566;p=thirdparty%2FPython%2Fcpython.git Issue #28513: Documented command-line interface of zipfile. --- 5a97bf7decafd3421c91565bc2f16e7b1992b566 diff --cc Doc/library/zipfile.rst index 47ba0b521e1d,905648914b37..97d31d94830c --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@@ -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 ++ --list + + List files in a zipfile. + + .. cmdoption:: -c ... ++ --create ... + + Create zipfile from source files. + + .. cmdoption:: -e ++ --extract + + Extract zipfile into target directory. + + .. cmdoption:: -t ++ --test + + Test whether the zipfile is valid or not. + + .. _PKZIP Application Note: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT diff --cc Misc/NEWS index a58b2089604d,7c76d7511800..c1ec9dca843e --- a/Misc/NEWS +++ 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 -----