From 920a9faa050441fbe064eed200f74dbdc0ba9663 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 19 Jul 2019 10:06:19 -0400 Subject: Changed all uses of sub-command to subcommand --- tests/test_argparse.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/test_argparse.py') diff --git a/tests/test_argparse.py b/tests/test_argparse.py index 74a5d16f..e5fa6dd0 100644 --- a/tests/test_argparse.py +++ b/tests/test_argparse.py @@ -192,31 +192,31 @@ def test_preservelist(argparse_app): class SubcommandApp(cmd2.Cmd): - """ Example cmd2 application where we a base command which has a couple sub-commands.""" + """ Example cmd2 application where we a base command which has a couple subcommands.""" def __init__(self): cmd2.Cmd.__init__(self) - # sub-command functions for the base command + # subcommand functions for the base command def base_foo(self, args): - """foo sub-command of base command""" + """foo subcommand of base command""" self.poutput(args.x * args.y) def base_bar(self, args): - """bar sub-command of base command""" + """bar subcommand of base command""" self.poutput('((%s))' % args.z) # create the top-level parser for the base command base_parser = argparse.ArgumentParser(prog='base') - base_subparsers = base_parser.add_subparsers(title='sub-commands', help='sub-command help') + base_subparsers = base_parser.add_subparsers(title='subcommands', help='subcommand help') - # create the parser for the "foo" sub-command + # create the parser for the "foo" subcommand parser_foo = base_subparsers.add_parser('foo', help='foo help') parser_foo.add_argument('-x', type=int, default=1, help='integer') parser_foo.add_argument('y', type=float, help='float') parser_foo.set_defaults(func=base_foo) - # create the parser for the "bar" sub-command + # create the parser for the "bar" subcommand parser_bar = base_subparsers.add_parser('bar', help='bar help') parser_bar.add_argument('z', help='string') parser_bar.set_defaults(func=base_bar) @@ -226,10 +226,10 @@ class SubcommandApp(cmd2.Cmd): """Base command help""" func = getattr(args, 'func', None) if func is not None: - # Call whatever sub-command function was selected + # Call whatever subcommand function was selected func(self, args) else: - # No sub-command was provided, so call help + # No subcommand was provided, so call help self.do_help('base') @pytest.fixture -- cgit v1.2.1