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.add_argument('--boolkwarg', action='store_true')
|
||||||
parser.set_defaults(func=$1_argparse)
|
parser.set_defaults(func=$1_argparse)
|
||||||
|
|
||||||
|
with opnot_context:
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
args.func(args)
|
return args.func(args)
|
||||||
|
|
||||||
]]></content>
|
]]></content>
|
||||||
<tabTrigger>argparse</tabTrigger>
|
<tabTrigger>argparse</tabTrigger>
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<snippet>
|
<snippet>
|
||||||
<content><![CDATA[
|
<content><![CDATA[
|
||||||
'''
|
|
||||||
from voussoirkit import betterhelp
|
from voussoirkit import betterhelp
|
||||||
|
|
||||||
|
# replace the following lines:
|
||||||
|
# args = parser.parse_args(argv)
|
||||||
|
# return args.func(args)
|
||||||
return betterhelp.single_main(argv, parser, __doc__)
|
return betterhelp.single_main(argv, parser, __doc__)
|
||||||
]]></content>
|
]]></content>
|
||||||
<tabTrigger>betterhelp</tabTrigger>
|
<tabTrigger>betterhelp</tabTrigger>
|
||||||
|
|
Loading…
Reference in a new issue