From 69908070106e7bdb29fdc859c3a147730aa4d226 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Mon, 26 Aug 2013 21:17:55 -0400 Subject: [PATCH] Updated the help command to mention the new create/edit capabilities. Vaguely followed the docopt syntax. --- cheat | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cheat b/cheat index 8014635..2abc94a 100755 --- a/cheat +++ b/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] ") + 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)