diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-12-06 13:40:58 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-12-06 13:40:58 -0500 |
commit | 5b9281f6dfb55d436e6a19ae41af5a8590fbaed7 (patch) | |
tree | 6b4d269801df6fb2634af3003fe28a29b010008f /cmd2/argparse_completer.py | |
parent | 23970dfdca765992157b8089f3a34f7fd4fa4f10 (diff) | |
parent | ea182bbea386288b1acfbc35c99243a457ff1036 (diff) | |
download | cmd2-git-5b9281f6dfb55d436e6a19ae41af5a8590fbaed7.tar.gz |
Merge branch 'master' into history
Diffstat (limited to 'cmd2/argparse_completer.py')
-rw-r--r-- | cmd2/argparse_completer.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py index 77a62b9d..18549e9e 100644 --- a/cmd2/argparse_completer.py +++ b/cmd2/argparse_completer.py @@ -1,4 +1,7 @@ # coding=utf-8 +# flake8: noqa C901 +# NOTE: Ignoreing flake8 cyclomatic complexity in this file because the complexity due to copy-and-paste overrides from +# argparse """ AutoCompleter interprets the argparse.ArgumentParser internals to automatically generate the completion options for each argument. @@ -595,7 +598,7 @@ class AutoCompleter(object): fill_width = int(term_size.columns * .6) - (token_width + 2) for item in completions: entry = '{: <{token_width}}{: <{fill_width}}'.format(item, item.description, - token_width=token_width+2, + token_width=token_width + 2, fill_width=fill_width) completions_with_desc.append(entry) @@ -603,7 +606,7 @@ class AutoCompleter(object): desc_header = action.desc_header except AttributeError: desc_header = 'Description' - header = '\n{: <{token_width}}{}'.format(action.dest.upper(), desc_header, token_width=token_width+2) + header = '\n{: <{token_width}}{}'.format(action.dest.upper(), desc_header, token_width=token_width + 2) self._cmd2_app.completion_header = header self._cmd2_app.display_matches = completions_with_desc |