Commit f6bea05f authored by Leigh B Stoller's avatar Leigh B Stoller

Some minor changes to make it easer to print a usage() error

message from scripts that want to have their own.
parent f9bd2d55
#! /usr/bin/env python
#
# Copyright (c) 2008-2012 University of Utah and the Flux Group.
# Copyright (c) 2008-2013 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -41,24 +41,9 @@ ACCEPTSLICENAME=1
def Usage():
print "usage: " + sys.argv[ 0 ] + " [option...] imagename sliver-urn [global]"
print """Options:
-c file, --credentials=file read self-credentials from file
[default: query from SA]
-d, --debug be verbose about XML methods invoked
-f file, --certificate=file read SSL certificate from file
[default: ~/.ssl/encrypted.pem]
-h, --help show options and usage
-l uri, --sa=uri specify uri of slice authority
[default: local]
-m uri, --cm=uri specify uri of component manager
[default: local]
-n name, --slicename=name specify human-readable name of slice
[default: mytestslice]
-p file, --passphrase=file read passphrase from file
[default: ~/.ssl/password]
-r file, --read-commands=file specify additional configuration file
-s file, --slicecredentials=file read slice credentials from file
[default: query from SA]"""
print "Options:"
BaseOptions()
pass
debug = 0
impotent = 1
......
#
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# Copyright (c) 2008-2013 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -62,7 +62,13 @@ admincredentialfile = None
if "Usage" not in dir():
def Usage():
print "usage: " + sys.argv[ 0 ] + " [option...]"
print """Options:
print "Options:"
BaseOptions()
pass
pass
def BaseOptions():
print """
-a file, --admincredentials=file read admin credentials from file
-c file, --credentials=file read self-credentials from file
[default: query from SA]
......@@ -74,14 +80,16 @@ if "Usage" not in dir():
[default: local]
-m uri, --cm=uri specify uri of component manager
[default: local]"""
if "ACCEPTSLICENAME" in globals():
print """ -n name, --slicename=name specify human-readable name of slice
if "ACCEPTSLICENAME" in globals():
print """ -n name, --slicename=name specify human-readable name of slice
[default: mytestslice]"""
print """ -p file, --passphrase=file read passphrase from file
pass
print """ -p file, --passphrase=file read passphrase from file
[default: ~/.ssl/password]
-r file, --read-commands=file specify additional configuration file
-s file, --slicecredentials=file read slice credentials from file
[default: query from SA]"""
pass
try:
opts, REQARGS = getopt.gnu_getopt( sys.argv[ 1: ], "a:c:df:hl:m:n:p:r:s:",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment