mirror of
https://github.com/cheat/cheat.git
synced 2024-11-21 21:41:35 +01:00
On help, the 'Available keyphrases' output is now alphabetized.
This commit is contained in:
parent
76cce9d584
commit
50b47445ad
13
cheat
13
cheat
@ -110,15 +110,14 @@ tar -cjvf /path/to/foo.tgz /path/to/foo/
|
||||
}
|
||||
|
||||
# print help if requested
|
||||
# @todo: alphabetize key names if possible
|
||||
if keyphrase in ['', 'help', '--help', '-h']:
|
||||
print 'Usage: cheat [keyphrase]'
|
||||
print 'Available keyphrases:'
|
||||
for key in cheatsheets:
|
||||
print key
|
||||
cheatsheets_sorted = cheatsheets.keys()
|
||||
cheatsheets_sorted.sort()
|
||||
|
||||
print "Usage: cheat [keyphrase]\n"
|
||||
print "Available keyphrases:"
|
||||
print "\n".join(cheatsheets_sorted)
|
||||
exit()
|
||||
|
||||
# print the cheatsheet if it exists
|
||||
# @todo: if I could get tab-completion on the cheatsheet names, that would
|
||||
# be awesome
|
||||
print cheatsheets[keyphrase] if keyphrase in cheatsheets.keys() else 'No cheatsheet found.'
|
||||
|
Loading…
Reference in New Issue
Block a user