mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944)
This commit is contained in:
parent
fd0cd07a5a
commit
150cd1916a
4 changed files with 28 additions and 14 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue