"""
Usage:
tar [-c] [options] <files>...
tar [-r | -u] -f ARCHIEVE [options] <files>...
tar [-t | -x] [options] [<patterns>...]
Options:
-h Print this message
-v Verbose
-z Gzip
-j Bzip2
-b BLOCKSIZE block size
-f ARCHIVE archive file
"""
from docopt import docopt
if __name__ == '__main__':
arguments = docopt(__doc__, version='0.0.1')
print(arguments)
% python tar.py -czb 128 -f docopt.gz test1.py test2.py
{'-b': '128',
'-c': 1,
'-f': [[['docopt.gz']]],
'-h': False,
'-j': False,
'-r': 0,
'-t': 0,
'-u': 0,
'-v': False,
'-x': 0,
'-z': True,
'<files>': ['test1.py', 'test2.py'],
'<patterns>': []}