@@ -13,9 +13,7 @@ def __init__(self):
1313 self .maxrepeats = 3
1414 cmd2 .Cmd .__init__ (self )
1515
16- argparser = argparse .ArgumentParser (
17- prog = 'say' ,
18- )
16+ argparser = argparse .ArgumentParser ()
1917 argparser .add_argument ('-p' , '--piglatin' , action = 'store_true' , help = 'atinLay' )
2018 argparser .add_argument ('-s' , '--shout' , action = 'store_true' , help = 'N00B EMULATION MODE' )
2119 argparser .add_argument ('-r' , '--repeat' , type = int , help = 'output [n] times' )
@@ -37,10 +35,7 @@ def do_say(self, cmdline, args=None):
3735 self .stdout .write (' ' .join (words ))
3836 self .stdout .write ('\n ' )
3937
40- argparser = argparse .ArgumentParser (
41- prog = 'tag' ,
42- description = 'create a html tag'
43- )
38+ argparser = argparse .ArgumentParser (description = 'create a html tag' )
4439 argparser .add_argument ('tag' , nargs = 1 , help = 'tag' )
4540 argparser .add_argument ('content' , nargs = '+' , help = 'content to surround with tag' )
4641 @cmd2 .with_argument_parser (argparser )
@@ -88,3 +83,9 @@ def test_argparse_help_docstring(argparse_app):
8883def test_argparse_help_description (argparse_app ):
8984 out = run_cmd (argparse_app , 'help tag' )
9085 assert out [2 ] == 'create a html tag'
86+
87+ def test_argparse_prog (argparse_app ):
88+ out = run_cmd (argparse_app , 'help tag' )
89+ progname = out [0 ].split (' ' )[1 ]
90+ assert progname == 'tag'
91+
0 commit comments