def parse_args(): parser = optparse.OptionParser(usage="%s [options] <prefix>" % (sys.argv[0],), description=__doc__) gce_credentials.add_credentials_options(parser) parser.add_option( "--prefix", action="store", dest="prefix", help="String used to prefix GCE resource names (default: %default)" ) (opts, args) = parser.parse_args() gce_credentials.check_required(opts, parser) if not args: parser.error("Missing required argument: name prefix") return (opts, args)
def parse_args(): parser = optparse.OptionParser( usage="%s [options] <prefix>" % (sys.argv[0],), description=__doc__) gce_credentials.add_credentials_options(parser) parser.add_option("--prefix", action="store", dest="prefix", help="String used to prefix GCE resource names (default: %default)") (opts, args) = parser.parse_args() gce_credentials.check_required(opts, parser) if not args: parser.error("Missing required argument: name prefix") return (opts, args)
def parse_args(): parser = optparse.OptionParser(usage="%s [options]" % (sys.argv[0],), description=__doc__) gce_credentials.add_credentials_options(parser) parser.add_option("--yes", "-y", action="store_true", dest="assumeyes", default=False, help="Don't prompt for confirmation") parser.add_option("--match", action="store", dest="match_re", default="^ansible-testing-", help="Regular expression used to find GCE resources (default: %default)") (opts, args) = parser.parse_args() gce_credentials.check_required(opts, parser) return (opts, args)