"""
Usage:
program (--opt=OPT...) (--ano=ANO...)
Options:
--opt=OPT An option that can be specified multiple times to form a list
--ano=ANO An option that can be specified multiple times to form a list
"""
import docopt
print docopt.docopt(__doc__)
With the code above the following works:
python program.py --opt 1.txt --opt 4.txt --ano 2.txt --ano 3.txt
{'--ano': ['2.txt', '3.txt'],
'--opt': ['1.txt', '4.txt']}
However, I'd like the following to work too (so that globbing is supported):
python program.py --opt 1.txt 4.txt --ano 2.txt 3.txt
Usage:
program (--opt=OPT...) (--ano=ANO...)
Like this:
python program --opt *.txt --ano *.csv
Can I achieve this with docopt?