diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-15 11:39:16 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-15 11:39:16 -0400 |
commit | bff6e04607ea9bede7bc981755cdf41740c15462 (patch) | |
tree | a653a9fe4a63a6fe6f840e6c17394204bbc99594 /cmd2 | |
parent | 87702b56c5b146ef9ce867343ceaa675ae9c1c21 (diff) | |
download | cmd2-git-bff6e04607ea9bede7bc981755cdf41740c15462.tar.gz |
Make max_completion_items settable
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/cmd2.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 6667911a..4ba2e83e 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -352,6 +352,12 @@ class Cmd(cmd.Cmd): self.editor = self.DEFAULT_EDITOR self.feedback_to_output = False # Do not include nonessentials in >, | output by default (things like timing) self.locals_in_py = False + + # The maximum number of CompletionItems to display during tab completion. If the number of completion + # suggestions exceeds this number, they will be displayed in the typical columnized format and will + # not include the description value of the CompletionItems. + self.max_completion_items = 50 + self.quiet = False # Do not suppress nonessential output self.timing = False # Prints elapsed time for each command @@ -369,6 +375,7 @@ class Cmd(cmd.Cmd): 'editor': 'Program used by ``edit``', 'feedback_to_output': 'Include nonessentials in `|`, `>` results', 'locals_in_py': 'Allow access to your application in py via self', + 'max_completion_items': 'Maximum number of CompletionItems to display during tab completion', 'prompt': 'The prompt issued to solicit input', 'quiet': "Don't print nonessential feedback", 'timing': 'Report execution times' @@ -467,11 +474,6 @@ class Cmd(cmd.Cmd): # Otherwise it can be set to any custom key to meet your needs. self.matches_sort_key = ALPHABETICAL_SORT_KEY - # The maximum number of CompletionItems to display during tab completion. If the number of completion - # suggestions exceeds this number, they will be displayed in the typical columnized format and will - # not include the description value of the CompletionItems. - self.max_completion_items = 50 - ############################################################################################################ # The following variables are used by tab-completion functions. They are reset each time complete() is run # in reset_completion_defaults() and it is up to completer functions to set them before returning results. |