summaryrefslogtreecommitdiff
path: root/cmd2/argparse_custom.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-18 16:08:32 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-18 16:08:32 -0400
commit858476599f1d8ac9642c36f0a573cbd596e47a67 (patch)
tree266a272ce3a0df475372e9cb824cb7cff2ef096e /cmd2/argparse_custom.py
parent8e656392c996e11642edbc5b4c6f96e4e614efeb (diff)
downloadcmd2-git-858476599f1d8ac9642c36f0a573cbd596e47a67.tar.gz
Renamed ArgParser to Cmd2ArgumentParser to make it clear it's a derived class of argparse.ArgumentParser
when developers read the code in cmd2.py.
Diffstat (limited to 'cmd2/argparse_custom.py')
-rw-r--r--cmd2/argparse_custom.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py
index 5d8e76ef..8da47461 100644
--- a/cmd2/argparse_custom.py
+++ b/cmd2/argparse_custom.py
@@ -1,14 +1,14 @@
# coding=utf-8
"""
This module adds capabilities to argparse by patching a few of its functions. It also defines a parser
-class called ArgParser which improves error and help output over normal argparse. All cmd2 code uses
+class called Cmd2ArgumentParser which improves error and help output over normal argparse. All cmd2 code uses
this parser and it is recommended that developers of cmd2-based apps either use it or write their own parser
that inherits from it. This will give a consistent look-and-feel between the help/error output of built-in
cmd2 commands and the app-specific commands.
-Since the new capabilities are added by patching at the argparse API level, they are available whether or
-not ArgParser is used. However, the help and error output of ArgParser is customized to notate nargs ranges
-whereas any other parser class won't be as explicit in their output.
+Since the new capabilities are added by patching at the argparse API level, they are available whether or not
+Cmd2ArgumentParser is used. However, the help and error output of Cmd2ArgumentParser is customized to notate
+nargs ranges whereas any other parser class won't be as explicit in their output.
############################################################################################################
# Added capabilities
@@ -634,7 +634,7 @@ class Cmd2HelpFormatter(argparse.RawTextHelpFormatter):
# noinspection PyCompatibility
-class ArgParser(argparse.ArgumentParser):
+class Cmd2ArgumentParser(argparse.ArgumentParser):
"""Custom ArgumentParser class that improves error and help output"""
def __init__(self, *args, **kwargs) -> None: