From: Tias Guns Date: Sun, 11 Mar 2012 21:15:17 +0000 (+0000) Subject: fdroid.py: a pointer to the -h option of commands X-Git-Tag: 0.1~828^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=409fd273b672135c12c9a12295a57339bad1e319;p=fdroidserver.git fdroid.py: a pointer to the -h option of commands --- diff --git a/fdroid b/fdroid index 20922475..f8f2473f 100755 --- a/fdroid +++ b/fdroid @@ -31,21 +31,23 @@ commands = [ "stats", "server"] +def print_help(): + print "Valid commands are:" + for command in commands: + print " " + command + print "Use '%s -h' for more info about that command."%sys.argv[0] + def main(): if len(sys.argv) <= 1: - print "Specify a command. Valid commands are:" - for command in commands: - print " " + command + print_help() sys.exit(0) command = sys.argv[1] if not command in commands: print "Command '" + command + "' not recognised." print "" - print "Valid commands are:" - for command in commands: - print " " + command + print_help() sys.exit(1) # Trick optparse into displaying the right usage when --help is used.