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:
Ryan Roden-Corrent 2016-08-01 12:11:26 -04:00
parent 81eb53a152
commit dd9470af94
2 changed files with 5 additions and 4 deletions

View File

@ -75,8 +75,8 @@ class HelpCompletionModel(base.BaseCompletionModel):
assert cmdutils.cmd_dict
cmdlist = []
for obj in set(cmdutils.cmd_dict.values()):
if (obj.hide or (obj.debug and not objreg.get('args').debug) or
obj.deprecated):
if ((obj.debug and not objreg.get('args').debug) or
obj.deprecated):
pass
else:
cmdlist.append((':' + obj.name, obj.desc))

View File

@ -193,7 +193,7 @@ def test_help_completion(qtmodeltester, monkeypatch, stubs):
"""Test the results of command completion.
Validates that:
- only non-hidden and non-deprecated commands are included
- only non-deprecated commands are included
- commands are sorted by name
- the command description is shown in the desc column
- the binding (if any) is shown in the misc column
@ -211,8 +211,9 @@ def test_help_completion(qtmodeltester, monkeypatch, stubs):
assert actual == [
("Commands", [
(':drop', 'drop all user data', ''),
(':hide', '', ''),
(':roll', 'never gonna give you up', ''),
(':stop', 'stop qutebrowser', '')
(':stop', 'stop qutebrowser', ''),
]),
("Settings", [
('general->time', 'Is an illusion.', ''),