summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2/AutoCompleter.py35
-rw-r--r--docs/requirements.txt3
2 files changed, 6 insertions, 32 deletions
diff --git a/cmd2/AutoCompleter.py b/cmd2/AutoCompleter.py
index 7f79cec1..a8d25895 100755
--- a/cmd2/AutoCompleter.py
+++ b/cmd2/AutoCompleter.py
@@ -685,36 +685,11 @@ class ACHelpFormatter(argparse.HelpFormatter):
class ACArgumentParser(argparse.ArgumentParser):
"""Custom argparse class to override error method to change default help text."""
- def __init__(self,
- prog=None,
- usage=None,
- description=None,
- epilog=None,
- parents=[],
- formatter_class=ACHelpFormatter,
- prefix_chars='-',
- fromfile_prefix_chars=None,
- argument_default=None,
- conflict_handler='error',
- add_help=True,
- allow_abbrev=True):
-
- params = {'prog': prog,
- 'usage': usage,
- 'description': description,
- 'epilog': epilog,
- 'parents': parents,
- 'formatter_class': formatter_class,
- 'prefix_chars': prefix_chars,
- 'fromfile_prefix_chars': fromfile_prefix_chars,
- 'argument_default': argument_default,
- 'conflict_handler': conflict_handler,
- 'add_help': add_help}
-
- if sys.version_info >= (3, 5):
- params['allow_abbrev'] = allow_abbrev
-
- super().__init__(**params)
+ def __init__(self, *args, **kwargs):
+ if 'formatter_class' not in kwargs:
+ kwargs['formatter_class'] = ACHelpFormatter
+
+ super().__init__(*args, **kwargs)
register_custom_actions(self)
self._custom_error_message = ''
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 4f05675a..9f2bbbc3 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,6 +1,5 @@
pyparsing
pyperclip
contextlib2
-enum34
-subprocess32
wcwidth
+colorama