summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-07 15:56:12 (GMT)
committerGitHub <noreply@github.com>2017-04-07 15:56:12 (GMT)
commit150cd1916a59e750ce88c65325de9ef0c42c6cb5 (patch)
tree546e715a7883526a32430d58791636768724d755 /Lib/zipfile.py
parentfd0cd07a5a3c964c084f4efc5bbcb89dd2193ee6 (diff)
downloadcpython-150cd1916a59e750ce88c65325de9ef0c42c6cb5.zip
cpython-150cd1916a59e750ce88c65325de9ef0c42c6cb5.tar.gz
cpython-150cd1916a59e750ce88c65325de9ef0c42c6cb5.tar.bz2
bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944)
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 6fdf2c3..550e64f 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1965,9 +1965,9 @@ class PyZipFile(ZipFile):
def main(args=None):
import argparse
- description = 'A simple command line interface for zipfile module.'
+ description = 'A simple command-line interface for zipfile module.'
parser = argparse.ArgumentParser(description=description)
- group = parser.add_mutually_exclusive_group()
+ group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('-l', '--list', metavar='<zipfile>',
help='Show listing of a zipfile')
group.add_argument('-e', '--extract', nargs=2,
@@ -2022,8 +2022,5 @@ def main(args=None):
zippath = ''
addToZip(zf, path, zippath)
- else:
- parser.exit(2, parser.format_usage())
-
if __name__ == "__main__":
main()