On Mon, 2005-08-01 at 19:28 -0500, Josh Boyer wrote:
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.
Here's an updated patch. Dan adds commands too quickly ;). It also
fixes the name of the program in Usage from 'package-client' to
'plague-client'.
josh
Index: extras-buildsys/client/client.py
===================================================================
--- extras-buildsys.orig/client/client.py
+++ extras-buildsys/client/client.py
@@ -313,22 +313,28 @@ def getEmailAddress():
return config_email
-
+def Usage():
+ print "Usage:\nplague-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 " finish <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
@@ -380,7 +386,11 @@ if __name__ == '__main__':
is_paused(server)
elif cmd == 'finish':
finish(server, sys.argv[2:])
+ elif cmd == 'help':
+ Usage()
+ sys.exit(1)
else:
print "Unknown command."
+ Usage()
sys.exit(1)