bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944)
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 @@
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 @@
zippath = ''
addToZip(zf, path, zippath)
- else:
- parser.exit(2, parser.format_usage())
-
if __name__ == "__main__":
main()