@@ -40,7 +40,7 @@ def do_banana(self, statement: cmd2.Statement):
40
40
"""Banana Command"""
41
41
self ._cmd .poutput ('Banana!!' )
42
42
43
- cranberry_parser = cmd2 .Cmd2ArgumentParser ('cranberry' )
43
+ cranberry_parser = cmd2 .Cmd2ArgumentParser ()
44
44
cranberry_parser .add_argument ('arg1' , choices = ['lemonade' , 'juice' , 'sauce' ])
45
45
46
46
@cmd2 .with_argparser (cranberry_parser , with_unknown_args = True )
@@ -65,7 +65,7 @@ def do_durian(self, args: List[str]):
65
65
def complete_durian (self , text : str , line : str , begidx : int , endidx : int ) -> List [str ]:
66
66
return utils .basic_complete (text , line , begidx , endidx , ['stinks' , 'smells' , 'disgusting' ])
67
67
68
- elderberry_parser = cmd2 .Cmd2ArgumentParser ('elderberry' )
68
+ elderberry_parser = cmd2 .Cmd2ArgumentParser ()
69
69
elderberry_parser .add_argument ('arg1' )
70
70
71
71
@cmd2 .with_category ('Alone' )
@@ -319,7 +319,7 @@ def __init__(self, dummy):
319
319
self ._dummy = dummy # prevents autoload
320
320
self ._cut_called = False
321
321
322
- cut_parser = cmd2 .Cmd2ArgumentParser ('cut' )
322
+ cut_parser = cmd2 .Cmd2ArgumentParser ()
323
323
cut_subparsers = cut_parser .add_subparsers (title = 'item' , help = 'item to cut' )
324
324
325
325
def namespace_provider (self ) -> argparse .Namespace :
@@ -340,8 +340,7 @@ def do_cut(self, ns: argparse.Namespace):
340
340
self ._cmd .pwarning ('This command does nothing without sub-parsers registered' )
341
341
self ._cmd .do_help ('cut' )
342
342
343
-
344
- stir_parser = cmd2 .Cmd2ArgumentParser ('stir' )
343
+ stir_parser = cmd2 .Cmd2ArgumentParser ()
345
344
stir_subparsers = stir_parser .add_subparsers (title = 'item' , help = 'what to stir' )
346
345
347
346
@cmd2 .with_argparser (stir_parser , ns_provider = namespace_provider )
@@ -613,7 +612,7 @@ class AppWithSubCommands(cmd2.Cmd):
613
612
def __init__ (self , * args , ** kwargs ):
614
613
super (AppWithSubCommands , self ).__init__ (* args , ** kwargs )
615
614
616
- cut_parser = cmd2 .Cmd2ArgumentParser ('cut' )
615
+ cut_parser = cmd2 .Cmd2ArgumentParser ()
617
616
cut_subparsers = cut_parser .add_subparsers (title = 'item' , help = 'item to cut' )
618
617
619
618
@cmd2 .with_argparser (cut_parser )
@@ -874,7 +873,7 @@ class BadSubcommandApp(cmd2.Cmd):
874
873
def __init__ (self , * args , ** kwargs ):
875
874
super (BadSubcommandApp , self ).__init__ (* args , ** kwargs )
876
875
877
- cut_parser = cmd2 .Cmd2ArgumentParser ('cut' )
876
+ cut_parser = cmd2 .Cmd2ArgumentParser ()
878
877
cut_subparsers = cut_parser .add_subparsers (title = 'item' , help = 'item to cut' )
879
878
880
879
@cmd2 .with_argparser (cut_parser )
0 commit comments