chiark / gitweb /
fdroid.py: a pointer to the -h option of commands
authorTias Guns <tias@ulyssis.org>
Sun, 11 Mar 2012 21:15:17 +0000 (21:15 +0000)
committerTias Guns <tias.guns@cs.kuleuven.be>
Sun, 11 Mar 2012 23:17:45 +0000 (23:17 +0000)
fdroid

diff --git a/fdroid b/fdroid
index 20922475ba215ea2ab356f7ecc4e4f3cb77714d6..f8f2473f5ff3e2221b1bbe0dfec5a3cec86eff57 100755 (executable)
--- 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 <command> -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.