Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2d305f3
Removed unused state argument to Cmd.complete().
kmvanbrunt Feb 4, 2026
ffe2a61
Updated comments to just say 'complete' instead of 'tab complete'.
kmvanbrunt Feb 4, 2026
5855053
Merge branch 'main' into refactor_complete
kmvanbrunt Feb 5, 2026
2da8a1a
First pass at restructuring completion functions and classes.
kmvanbrunt Feb 5, 2026
ab703cb
Fixed completion hint not displaying while completing a command name.
kmvanbrunt Feb 6, 2026
20bdbd3
Further refactoring of completion code to better utilize prompt-toolkit.
kmvanbrunt Feb 12, 2026
94bbeb3
Replaced choices_provider and completer protocols with type aliases.
kmvanbrunt Feb 13, 2026
b0a3164
Corrected auto-quoting of completions.
kmvanbrunt Feb 14, 2026
fb13964
Fixed issue where argparse flags all displayed the same name in the c…
kmvanbrunt Feb 14, 2026
1d125d2
Fixed sort order of argparse flags in completion menu.
kmvanbrunt Feb 14, 2026
80ff944
Updated test_cmd2.py for the new completion API.
kmvanbrunt Feb 14, 2026
67d4a66
Renamed CompletionResultsBase.from_strings() to from_values().
kmvanbrunt Feb 14, 2026
bad78a4
Move completion exception handling back to Cmd.complete().
kmvanbrunt Feb 14, 2026
96477e2
Fixed most tests in test_argparse_completer.py.
kmvanbrunt Feb 15, 2026
f2cb61d
Fixed remaining tests in test_argparse_completer.py.
kmvanbrunt Feb 16, 2026
6a59fb8
Fixed tests in test_commandset.py.
kmvanbrunt Feb 16, 2026
b880914
Fixed tests in test_argparse_custom.py.
kmvanbrunt Feb 16, 2026
04e96c2
Fixed tests in test_dynamic_complete_style.py.
kmvanbrunt Feb 16, 2026
e8733bc
Removed extra newlines when printing exceptions during completion.
kmvanbrunt Feb 16, 2026
5bbd0f7
Fixed typo and doc formatting.
kmvanbrunt Feb 16, 2026
b3ee325
Fixed tests in test_pt_utils.py.
kmvanbrunt Feb 16, 2026
34bfac9
Merge branch 'main' into refactor_complete
kmvanbrunt Feb 16, 2026
ad8ec9e
Updated types for some functions in completion.py.
kmvanbrunt Feb 17, 2026
b370588
Fixed type issues.
kmvanbrunt Feb 17, 2026
f2bce71
Fixed tests in test_completion.py.
kmvanbrunt Feb 17, 2026
343fcad
Updated change log and docs.
kmvanbrunt Feb 17, 2026
c851f64
Fixed formatting in change log.
kmvanbrunt Feb 17, 2026
cf9243f
Updated argparse_custom documentation.
kmvanbrunt Feb 17, 2026
1f49511
Added completion test to handle word break in a quoted token.
kmvanbrunt Feb 17, 2026
883d87c
Increased test coverage.
kmvanbrunt Feb 17, 2026
9630d92
Fixed linting error.
kmvanbrunt Feb 17, 2026
4b40d77
Reformatted some imports.
kmvanbrunt Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ shell, and the option for a persistent bottom bar that can display realtime stat
`cmd2.Cmd.async_alert`
- Removed `cmd2.Cmd.async_refresh_prompt` and `cmd2.Cmd.need_prompt_refresh` as they are no
longer needed
- `completer` functions must now return a `cmd2.Completions` object instead of `list[str]`.
- `choices_provider` functions must now return a `cmd2.Choices` object instead of `list[str]`.
- An argparse argument's `descriptive_headers` field is now called `table_header`.
- `CompletionItem.descriptive_data` is now called `CompletionItem.table_row`.
- `Cmd.default_sort_key` moved to `utils.DEFAULT_STR_SORT_KEY`.
- Moved completion state data, which previously resided in `Cmd`, into other classes.
1. `Cmd.matches_sorted` -> `Completions.is_sorted` and `Choices.is_sorted`
1. `Cmd.completion_hint` -> `Completions.completion_hint`
1. `Cmd.formatted_completions` -> `Completions.completion_table`
1. `Cmd.matches_delimited` -> `Completions.is_delimited`
1. `Cmd.allow_appended_space/allow_closing_quote` -> `Completions.allow_finalization`
- Enhancements
- New `cmd2.Cmd` parameters
- **auto_suggest**: (boolean) if `True`, provide fish shell style auto-suggestions. These
Expand Down
13 changes: 11 additions & 2 deletions cmd2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from .argparse_custom import (
Cmd2ArgumentParser,
Cmd2AttributeWrapper,
CompletionItem,
register_argparse_argument_parameter,
set_default_argument_parser_type,
)
Expand All @@ -25,6 +24,11 @@
CommandSet,
with_default_category,
)
from .completion import (
Choices,
CompletionItem,
Completions,
)
from .constants import (
COMMAND_NAME,
DEFAULT_SHORTCUTS,
Expand Down Expand Up @@ -52,6 +56,7 @@
CustomCompletionSettings,
Settable,
categorize,
set_default_str_sort_key,
)

__all__: list[str] = [ # noqa: RUF022
Expand All @@ -60,7 +65,6 @@
# Argparse Exports
'Cmd2ArgumentParser',
'Cmd2AttributeWrapper',
'CompletionItem',
'register_argparse_argument_parameter',
'set_default_ap_completer_type',
'set_default_argument_parser_type',
Expand All @@ -71,6 +75,10 @@
'Statement',
# Colors
"Color",
# Completion
'Choices',
'CompletionItem',
'Completions',
# Decorators
'with_argument_list',
'with_argparser',
Expand Down Expand Up @@ -98,4 +106,5 @@
'CompletionMode',
'CustomCompletionSettings',
'Settable',
'set_default_str_sort_key',
]
Loading
Loading