X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/blobdiff_plain/8ad9f90741a2f254ee1dedd51befc464319c6b25..1c9ac2563d5afefb47da45c352f4bdd25acf8635:/invirt-submit-build diff --git a/invirt-submit-build b/invirt-submit-build index 42446b0..8175865 100755 --- a/invirt-submit-build +++ b/invirt-submit-build @@ -18,6 +18,7 @@ keeping. import datetime +import optparse import os import sys import tempfile @@ -27,7 +28,12 @@ import invirt.builder as b def main(): - pocket, package, commit = sys.argv[1:4] + parser = optparse.OptionParser('Usage: %prog pocket package commit') + opts, args = parser.parse_args() + if len(args) != 3: + parser.print_help() + return 1 + pocket, package, commit = args principal = os.environ['REMOTE_USER'] request_time = datetime.datetime.utcnow() q_path = os.path.join(b._QUEUE_DIR, @@ -46,6 +52,7 @@ def main(): q_fd, q_name = tempfile.mkstemp() q = os.fdopen(q_fd, 'r+') print >>q, "%s %s %s %s" % (pocket, package, commit, principal) + q.close() os.rename(q_name, q_path)