Fix some boilerplate snippets.
This commit is contained in:
parent
77349d63a8
commit
568323bbc9
2 changed files with 6 additions and 3 deletions
|
@ -15,8 +15,9 @@ def main(argv):
|
|||
parser.add_argument('--boolkwarg', action='store_true')
|
||||
parser.set_defaults(func=$1_argparse)
|
||||
|
||||
args = parser.parse_args(argv)
|
||||
args.func(args)
|
||||
with opnot_context:
|
||||
args = parser.parse_args(argv)
|
||||
return args.func(args)
|
||||
|
||||
]]></content>
|
||||
<tabTrigger>argparse</tabTrigger>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<snippet>
|
||||
<content><![CDATA[
|
||||
'''
|
||||
from voussoirkit import betterhelp
|
||||
|
||||
# replace the following lines:
|
||||
# args = parser.parse_args(argv)
|
||||
# return args.func(args)
|
||||
return betterhelp.single_main(argv, parser, __doc__)
|
||||
]]></content>
|
||||
<tabTrigger>betterhelp</tabTrigger>
|
||||
|
|
Loading…
Reference in a new issue