summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--cliff/help.py2
-rw-r--r--cliff/tests/test_help.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index e7117ad..a4db32e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,7 @@ pip-log.txt
# pbr output
AUTHORS
ChangeLog
+
+# Editors
+*~
+.*.swp
diff --git a/cliff/help.py b/cliff/help.py
index 3569ccc..a0b49e2 100644
--- a/cliff/help.py
+++ b/cliff/help.py
@@ -67,7 +67,7 @@ class HelpCommand(Command):
if not fuzzy_matches:
raise
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)
return
self.app_args.cmd = search_args
diff --git a/cliff/tests/test_help.py b/cliff/tests/test_help.py
index 19eaedc..3b44899 100644
--- a/cliff/tests/test_help.py
+++ b/cliff/tests/test_help.py
@@ -47,8 +47,7 @@ def test_list_matching_commands():
pass
help_output = stdout.getvalue()
assert 'Command "t" matches:' in help_output
- assert 'two' in help_output
- assert 'three' in help_output
+ assert 'three word command\n two words\n' in help_output
def test_list_matching_commands_no_match():