Hi all,
This patch cleans up the Usage message in plague-client by listing all
of the available commands and moving them into a function. It also adds
a help command, which I think was asked for by Jef.
thx,
josh
Index: extras-buildsys/client/client.py
===================================================================
--- extras-buildsys.orig/client/client.py
+++ extras-buildsys/client/client.py
@@ -300,22 +300,27 @@ def getEmailAddress():
return config_email
-
+def Usage():
+ print "Usage:\npackage-client.py <command>\n"
+ print " <command> is one of:"
+ print " build [package_name] [cvs_tag | srpm_path] [target]"
+ print " list"
+ print " list <status>"
+ print " list <email> <status>"
+ print " kill <jobid>"
+ print " update_builders"
+ print " list_builders"
+ print " pause"
+ print " unpause"
+ print " is_paused"
+ print " requeue <jobid>"
+ print " detail <jobid>"
+ print " help"
+ print ""
if __name__ == '__main__':
if len(sys.argv) < 2:
- print "Usage:\npackage-builder.py <command>\n"
- print " <command> is one of:"
- print " build [package_name] [cvs_tag | srpm_path] [target]"
- print " list"
- print " list <status>"
- print " list <email> <status>"
- print " kill <jobid>"
- print " update_builders"
- print " list_builders"
- print " pause"
- print " unpause"
- print ""
+ Usage()
sys.exit(1)
# Write out config file if it doesn't exist
@@ -365,7 +370,11 @@ if __name__ == '__main__':
pause(server, False)
elif cmd == 'is_paused':
is_paused(server)
+ elif cmd == 'help':
+ Usage()
+ sys.exit(1)
else:
print "Unknown command."
+ Usage()
sys.exit(1)