From 409fd273b672135c12c9a12295a57339bad1e319 Mon Sep 17 00:00:00 2001 From: Tias Guns Date: Sun, 11 Mar 2012 21:15:17 +0000 Subject: [PATCH] fdroid.py: a pointer to the -h option of commands --- fdroid | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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. -- 2.30.2