diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-07 15:56:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 15:56:12 (GMT) |
commit | 150cd1916a59e750ce88c65325de9ef0c42c6cb5 (patch) | |
tree | 546e715a7883526a32430d58791636768724d755 /Lib/zipfile.py | |
parent | fd0cd07a5a3c964c084f4efc5bbcb89dd2193ee6 (diff) | |
download | cpython-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.py | 7 |
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() |