mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 21:52:12 +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
1 changed files with 15 additions and 1 deletions
16
cheat
16
cheat
|
@ -98,7 +98,21 @@ def main():
|
|||
|
||||
# print help if requested
|
||||
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:")
|
||||
max_command = max([len(x) for x in cheatsheets.keys()]) + 3
|
||||
print ('\n'.join(sorted(['%s [%s]' % (key.ljust(max_command), value)
|
||||
|
|
Loading…
Reference in a new issue