Sort the fuzzy matches
Sort the fuzzy matches alphabetically: (.venv)terry@f350:~/python-openstackclient$ os help server Command "server" matches: server add security group server add volume server create server delete server image create server list server lock ... Change-Id: If6e6b6b31d78fce1f37019d486b15a9a78253c33
This commit is contained in:
parent
442c4d7eb7
commit
a84421ede7
|
@ -34,3 +34,7 @@ pip-log.txt
|
||||||
# pbr output
|
# pbr output
|
||||||
AUTHORS
|
AUTHORS
|
||||||
ChangeLog
|
ChangeLog
|
||||||
|
|
||||||
|
# Editors
|
||||||
|
*~
|
||||||
|
.*.swp
|
||||||
|
|
|
@ -67,7 +67,7 @@ class HelpCommand(Command):
|
||||||
if not fuzzy_matches:
|
if not fuzzy_matches:
|
||||||
raise
|
raise
|
||||||
self.app.stdout.write('Command "%s" matches:\n' % cmd)
|
self.app.stdout.write('Command "%s" matches:\n' % cmd)
|
||||||
for fm in fuzzy_matches:
|
for fm in sorted(fuzzy_matches):
|
||||||
self.app.stdout.write(' %s\n' % fm)
|
self.app.stdout.write(' %s\n' % fm)
|
||||||
return
|
return
|
||||||
self.app_args.cmd = search_args
|
self.app_args.cmd = search_args
|
||||||
|
|
|
@ -47,8 +47,7 @@ def test_list_matching_commands():
|
||||||
pass
|
pass
|
||||||
help_output = stdout.getvalue()
|
help_output = stdout.getvalue()
|
||||||
assert 'Command "t" matches:' in help_output
|
assert 'Command "t" matches:' in help_output
|
||||||
assert 'two' in help_output
|
assert 'three word command\n two words\n' in help_output
|
||||||
assert 'three' in help_output
|
|
||||||
|
|
||||||
|
|
||||||
def test_list_matching_commands_no_match():
|
def test_list_matching_commands_no_match():
|
||||||
|
|
Loading…
Reference in New Issue