Skip to content

Commit 65f246e

Browse files
committed
Deleted an unused method and updated a method comment
1 parent 340b688 commit 65f246e

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
## 4.0.0 (TBD)
1+
## 4.0.0 (TBD, 2026)
22

3-
- Breaking Changes
3+
- Potentially Breaking Changes
44
- `cmd2` no longer has a dependency on `cmd` and `cmd2.Cmd` no longer inherits from `cmd.Cmd`
5+
- We don't _think_ this should impact users, but there is theoretically a possibility
56

67
## 3.0.0 (December 7, 2025)
78

cmd2/cmd2.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,16 +3314,12 @@ def default(self, statement: Statement) -> bool | None: # type: ignore[override
33143314
def completedefault(self, *_ignored: list[str]) -> list[str]:
33153315
"""Call to complete an input line when no command-specific complete_*() method is available.
33163316
3317-
By default, it returns an empty list.
3317+
This method is only called for non-argparse-based commands.
33183318
3319+
By default, it returns an empty list.
33193320
"""
33203321
return []
33213322

3322-
def completenames(self, text: str, *_ignored: list[str]) -> list[str]:
3323-
"""Help provide tab-completion options for command names."""
3324-
dotext = 'do_' + text
3325-
return [a[3:] for a in self.get_names() if a.startswith(dotext)]
3326-
33273323
def _suggest_similar_command(self, command: str) -> str | None:
33283324
return suggest_similar(command, self.get_visible_commands())
33293325

tests/test_completion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def test_cmd2_command_completion_single(cmd2_app) -> None:
224224
line = text
225225
endidx = len(line)
226226
begidx = endidx - len(text)
227-
assert cmd2_app.completenames(text, line, begidx, endidx) == ['help']
227+
assert cmd2_app.basic_complete(text, line, begidx, endidx, cmd2_app.get_all_commands()) == ['help']
228228

229229

230230
def test_complete_command_single(cmd2_app) -> None:
@@ -322,15 +322,15 @@ def test_cmd2_command_completion_multiple(cmd2_app) -> None:
322322
line = text
323323
endidx = len(line)
324324
begidx = endidx - len(text)
325-
assert cmd2_app.completenames(text, line, begidx, endidx) == ['help', 'history']
325+
assert cmd2_app.basic_complete(text, line, begidx, endidx, cmd2_app.get_all_commands()) == ['help', 'history']
326326

327327

328328
def test_cmd2_command_completion_nomatch(cmd2_app) -> None:
329329
text = 'fakecommand'
330330
line = text
331331
endidx = len(line)
332332
begidx = endidx - len(text)
333-
assert cmd2_app.completenames(text, line, begidx, endidx) == []
333+
assert cmd2_app.basic_complete(text, line, begidx, endidx, cmd2_app.get_all_commands()) == []
334334

335335

336336
def test_cmd2_help_completion_single(cmd2_app) -> None:

0 commit comments

Comments
 (0)