diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-18 20:05:22 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-18 20:05:22 -0400 |
commit | 6b0d357f1bf10c99397e88a6e914f53f95add6a6 (patch) | |
tree | 212996e2b24340c890ba4bdcaece402e8cf09aad /cmd2/argparse_custom.py | |
parent | d589e0a91afb609f0401deac20c9f709ad996b25 (diff) | |
parent | 9b1852a9f99a4fa248224c18c8cd2092edbbd8d2 (diff) | |
download | cmd2-git-6b0d357f1bf10c99397e88a6e914f53f95add6a6.tar.gz |
Merge branch 'master' into sigint_protection
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: |