Created
January 31, 2017 13:39
-
-
Save dracos/a5d40c0466ebfda1068b00e1eb2d056b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('args', nargs='*') # from __init__.py execute() | |
parser.add_argument('args', nargs='+') # from base.py LabelCommand add_arguments | |
print parser.parse_args(['foo1', 'foo2', 'foo3', 'foo4']) | |
# Outputs Namespace(args=['foo4']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment