Show hidden commands in help completion.
Hidden commands are not shown in command completion as they typically would not be run directly. However, a user might still might like to see help for them if, for example, they are writing a script or creating a binding. Addresses #1707.
This commit is contained in:
parent
81eb53a152
commit
dd9470af94
@ -75,7 +75,7 @@ class HelpCompletionModel(base.BaseCompletionModel):
|
|||||||
assert cmdutils.cmd_dict
|
assert cmdutils.cmd_dict
|
||||||
cmdlist = []
|
cmdlist = []
|
||||||
for obj in set(cmdutils.cmd_dict.values()):
|
for obj in set(cmdutils.cmd_dict.values()):
|
||||||
if (obj.hide or (obj.debug and not objreg.get('args').debug) or
|
if ((obj.debug and not objreg.get('args').debug) or
|
||||||
obj.deprecated):
|
obj.deprecated):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -193,7 +193,7 @@ def test_help_completion(qtmodeltester, monkeypatch, stubs):
|
|||||||
"""Test the results of command completion.
|
"""Test the results of command completion.
|
||||||
|
|
||||||
Validates that:
|
Validates that:
|
||||||
- only non-hidden and non-deprecated commands are included
|
- only non-deprecated commands are included
|
||||||
- commands are sorted by name
|
- commands are sorted by name
|
||||||
- the command description is shown in the desc column
|
- the command description is shown in the desc column
|
||||||
- the binding (if any) is shown in the misc column
|
- the binding (if any) is shown in the misc column
|
||||||
@ -211,8 +211,9 @@ def test_help_completion(qtmodeltester, monkeypatch, stubs):
|
|||||||
assert actual == [
|
assert actual == [
|
||||||
("Commands", [
|
("Commands", [
|
||||||
(':drop', 'drop all user data', ''),
|
(':drop', 'drop all user data', ''),
|
||||||
|
(':hide', '', ''),
|
||||||
(':roll', 'never gonna give you up', ''),
|
(':roll', 'never gonna give you up', ''),
|
||||||
(':stop', 'stop qutebrowser', '')
|
(':stop', 'stop qutebrowser', ''),
|
||||||
]),
|
]),
|
||||||
("Settings", [
|
("Settings", [
|
||||||
('general->time', 'Is an illusion.', ''),
|
('general->time', 'Is an illusion.', ''),
|
||||||
|
Loading…
Reference in New Issue
Block a user