bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944)

This commit is contained in:
Serhiy Storchaka 2017-04-07 18:56:12 +03:00 committed by GitHub
parent fd0cd07a5a
commit 150cd1916a
4 changed files with 28 additions and 14 deletions

View file

@ -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()