summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-21 22:24:09 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-21 22:24:09 -0500
commitc9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b (patch)
treee2e2f7f6ade5e61a625a3737106918e5e4362aaa /cmd2.py
parent711d6380d347260a99d9ed77ce0afa7cdae67da7 (diff)
downloadcmd2-git-c9f7c012bda012b4df7a8c5e853bd5d3e6d99b1b.tar.gz
Renamed @with_argument_parser decorator to @with_argparser
Also: - Reanamed foo and bar subcommand methods to base_foo and base_bar
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2.py b/cmd2.py
index 0e57da89..aee6f958 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -308,7 +308,7 @@ def with_argparser_and_unknown_args(argparser, subcommand_names=None):
return arg_decorator
-def with_argument_parser(argparser, subcommand_names=None):
+def with_argparser(argparser, subcommand_names=None):
"""A decorator to alter a cmd2 method to populate its ``args`` argument by parsing arguments
with the given instance of argparse.ArgumentParser.
@@ -1463,7 +1463,7 @@ class Cmd(cmd.Cmd):
set_parser.add_argument('-l', '--long', action='store_true', help='describe function of parameter')
set_parser.add_argument('settable', nargs='*', help='[param_name] [value]')
- @with_argument_parser(set_parser)
+ @with_argparser(set_parser)
def do_set(self, args):
"""Sets a settable parameter or shows current settings of parameters.
@@ -1825,7 +1825,7 @@ a..b, a:b, a:, ..b items by indices (inclusive)
/regex/ items matching regular expression"""
history_parser.add_argument('arg', nargs='?', help=_history_arg_help)
- @with_argument_parser(history_parser)
+ @with_argparser(history_parser)
def do_history(self, args):
"""View, run, edit, and save previously entered commands."""
# If an argument was supplied, then retrieve partial contents of the history