diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-18 20:04:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-18 20:04:50 -0400 |
commit | 9b1852a9f99a4fa248224c18c8cd2092edbbd8d2 (patch) | |
tree | 266a272ce3a0df475372e9cb824cb7cff2ef096e /cmd2/argparse_custom.py | |
parent | 8e656392c996e11642edbc5b4c6f96e4e614efeb (diff) | |
parent | 858476599f1d8ac9642c36f0a573cbd596e47a67 (diff) | |
download | cmd2-git-9b1852a9f99a4fa248224c18c8cd2092edbbd8d2.tar.gz |
Merge pull request #731 from python-cmd2/rename_argparser
Renamed cmd'2 parser to Cmd2ArgumentParser
Diffstat (limited to 'cmd2/argparse_custom.py')
-rw-r--r-- | cmd2/argparse_custom.py | 10 |
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: |