def checkArgs(): # The arguments to be passed to this script. parser = utils.ArgumentParser() parser.add_argument("--jobname", help="Job name", required=True) parser.add_argument("--jobid", help="Job id", required=True, type=int) parser.add_argument("--ccid", help="Command Center id", required=True, type=int) parser.add_argument("--phasename", help="Phase name", required=True) parser.add_argument("--jobdef", help="Job definition name", required=True) parser.add_argument("--lob", help="Line of business", required=True) parser.add_argument("--bor", help="Book of record", required=True) parser.add_argument("--jobdir", help="Job directory", required=True) parser.add_argument("--docidfile", help="Docid file name", required=True) parser.add_argument("--pdfurl", help="Pdf retrieve base url", required=True) parser.add_argument("--pdfpath", help="Pdf output path", required=True) try: args = vars(parser.parse_args()) # Invalid argument. except argparse.ArgumentError, exc: sys.stderr.write("Invalid argument: " \ + exc.argument.option_strings[0] + " " + exc.message + "\n") sys.exit(EXIT["System Error"])
def _run_or_rebot_from_cli(method, cliargs, usage, **argparser_config): LOGGER.register_file_logger() ap = utils.ArgumentParser(usage, get_full_version()) try: options, datasources = \ ap.parse_args(cliargs, argfile='argumentfile', unescape='escape', help='help', version='version', check_args=True, **argparser_config) except Information, msg: _exit(INFO_PRINTED, utils.unic(msg))
def checkArgs(): # The arguments to be passed to this script. parser = utils.ArgumentParser() parser.add_argument("--jobid", help="Job id", required=True, type=int) parser.add_argument("--ccid", help="Command Center id", required=True, \ type=int) parser.add_argument("--phasename", help="Phase name", required=True) try: args = vars(parser.parse_args()) # Invalid argument. except argparse.ArgumentError, exc: sys.stderr.write("Invalid argument: " \ + exc.argument.option_strings[0] + " " + exc.message + "\n") sys.exit(EXIT["System Error"])