mirror of
https://github.com/cheat/cheat.git
synced 2024-11-22 14:01:36 +01:00
Updated the help command to mention the new create/edit capabilities. Vaguely followed the docopt syntax.
This commit is contained in:
parent
3e7dcc9b43
commit
6990807010
16
cheat
16
cheat
@ -98,7 +98,21 @@ def main():
|
|||||||
|
|
||||||
# print help if requested
|
# print help if requested
|
||||||
if keyphrase.lower() in ['', 'cheat', 'help', '-h', '-help', '--help']:
|
if keyphrase.lower() in ['', 'cheat', 'help', '-h', '-help', '--help']:
|
||||||
print ("Usage: cheat [keyphrase]\n")
|
print ("Usage: cheat [OPTIONS] <keyphrase>")
|
||||||
|
print ("Examples:\n")
|
||||||
|
|
||||||
|
print ("To look up 'tar':")
|
||||||
|
print ("cheat tar\n")
|
||||||
|
|
||||||
|
print ("To look up 'git commit' (a subcommand):")
|
||||||
|
print ("cheat git commit\n")
|
||||||
|
|
||||||
|
print ("To create a cheatsheet for 'foo':")
|
||||||
|
print ("cheat -c foo\n")
|
||||||
|
|
||||||
|
print ("To edit the cheatsheet for 'foo':")
|
||||||
|
print ("cheat -e foo\n")
|
||||||
|
|
||||||
print ("Available keyphrases:")
|
print ("Available keyphrases:")
|
||||||
max_command = max([len(x) for x in cheatsheets.keys()]) + 3
|
max_command = max([len(x) for x in cheatsheets.keys()]) + 3
|
||||||
print ('\n'.join(sorted(['%s [%s]' % (key.ljust(max_command), value)
|
print ('\n'.join(sorted(['%s [%s]' % (key.ljust(max_command), value)
|
||||||
|
Loading…
Reference in New Issue
Block a user