summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/cmd2.py12
-rw-r--r--tests/conftest.py2
-rw-r--r--tests/transcripts/regex_set.txt1
3 files changed, 10 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.
diff --git a/tests/conftest.py b/tests/conftest.py
index 8040c21d..c0aea4a6 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -95,6 +95,7 @@ echo: False
editor: vim
feedback_to_output: False
locals_in_py: False
+max_completion_items: 50
prompt: (Cmd)
quiet: False
timing: False
@@ -108,6 +109,7 @@ echo: False # Echo command issued into output
editor: vim # Program used by ``edit``
feedback_to_output: False # Include nonessentials in `|`, `>` results
locals_in_py: False # Allow access to your application in py via self
+max_completion_items: 50 # Maximum number of CompletionItems to display during tab completion
prompt: (Cmd) # The prompt issued to solicit input
quiet: False # Don't print nonessential feedback
timing: False # Report execution times
diff --git a/tests/transcripts/regex_set.txt b/tests/transcripts/regex_set.txt
index 02bc9875..fdcca3a8 100644
--- a/tests/transcripts/regex_set.txt
+++ b/tests/transcripts/regex_set.txt
@@ -11,6 +11,7 @@ echo: False
editor: /.*/
feedback_to_output: False
locals_in_py: False
+max_completion_items: 50
maxrepeats: 3
prompt: (Cmd)/ /
quiet: False