summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-05 22:15:11 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-05 22:15:11 -0500
commit2fd85015d9f08a539dea1f8c63c1f1e2da54ab2d (patch)
treeeca08175c731e8bc8cde8511951f60451ff20fc2
parent5997d96dd2e17a9e84af8a515313a02e546c27e0 (diff)
downloadcmd2-git-2fd85015d9f08a539dea1f8c63c1f1e2da54ab2d.tar.gz
No longer displaying list of subcommands in usage text of alias and macro
-rw-r--r--cmd2/cmd2.py4
-rwxr-xr-xtests/test_cmd2.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 9f304537..65caa0df 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2279,7 +2279,7 @@ class Cmd(cmd.Cmd):
alias_parser = DEFAULT_ARGUMENT_PARSER(description=alias_description, epilog=alias_epilog)
# Add subcommands to alias
- alias_subparsers = alias_parser.add_subparsers(dest='subcommand')
+ alias_subparsers = alias_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND')
alias_subparsers.required = True
# alias -> create
@@ -2455,7 +2455,7 @@ class Cmd(cmd.Cmd):
macro_parser = DEFAULT_ARGUMENT_PARSER(description=macro_description, epilog=macro_epilog)
# Add subcommands to macro
- macro_subparsers = macro_parser.add_subparsers(dest='subcommand')
+ macro_subparsers = macro_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND')
macro_subparsers.required = True
# macro -> create
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index fecab628..0b4c60d6 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1552,7 +1552,7 @@ def test_get_settable_completion_items(base_app):
def test_alias_no_subcommand(base_app):
out, err = run_cmd(base_app, 'alias')
assert "Usage: alias [-h]" in err[0]
- assert "Error: the following arguments are required: subcommand" in err[1]
+ assert "Error: the following arguments are required: SUBCOMMAND" in err[1]
def test_alias_create(base_app):
# Create the alias
@@ -1646,7 +1646,7 @@ def test_multiple_aliases(base_app):
def test_macro_no_subcommand(base_app):
out, err = run_cmd(base_app, 'macro')
assert "Usage: macro [-h]" in err[0]
- assert "Error: the following arguments are required: subcommand" in err[1]
+ assert "Error: the following arguments are required: SUBCOMMAND" in err[1]
def test_macro_create(base_app):
# Create the macro