From 858476599f1d8ac9642c36f0a573cbd596e47a67 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 18 Jul 2019 16:08:32 -0400 Subject: Renamed ArgParser to Cmd2ArgumentParser to make it clear it's a derived class of argparse.ArgumentParser when developers read the code in cmd2.py. --- cmd2/argparse_custom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd2/argparse_custom.py') 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: -- cgit v1.2.1