Update argparse.sublime-snippet with more newlines.

This commit is contained in:
voussoir 2022-05-07 10:32:37 -07:00
parent 03091d6478
commit 5b30d9bc4f
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -7,12 +7,27 @@ def $1_argparse(args):
return 0 return 0
def main(argv): def main(argv):
parser = argparse.ArgumentParser(description=__doc__) parser = argparse.ArgumentParser(
description='''
parser.add_argument('required_positional') ''',
parser.add_argument('optional_positional', nargs='?', default=None) )
parser.add_argument('--kwarg', default=None) parser.add_argument(
parser.add_argument('--boolkwarg', action='store_true') 'required_positional',
help='''
''',
)
parser.add_argument(
'--kwarg',
default=None,
help='''
''',
)
parser.add_argument(
'--boolkwarg',
action='store_true',
help='''
''',
)
parser.set_defaults(func=$1_argparse) parser.set_defaults(func=$1_argparse)
args = parser.parse_args(argv) args = parser.parse_args(argv)