def parse_input(argv): ############################################################################### if "--test" in argv: test_results = doctest.testmod(verbose=True) sys.exit(1 if test_results.failed > 0 else 0) parser = argparse.ArgumentParser() setup_standard_logging_options(parser) parser.add_argument("caseroot", default=os.getcwd(), help="Case directory") parser.add_argument("libroot", help="root for creating the library") parser.add_argument("bldroot", help="root for building library") args = parse_args_and_handle_standard_logging_options(argv, parser) # Some compilers have trouble with long include paths, setting # EXEROOT to the relative path from bldroot solves the problem # doing it in the environment means we don't need to change all of # the component buildlib scripts with Case(args.caseroot) as case: os.environ["EXEROOT"] = os.path.relpath(case.get_value("EXEROOT"), args.bldroot) return args.caseroot, args.libroot, args.bldroot
def parse_input(argv): ############################################################################### if "--test" in argv: test_results = doctest.testmod(verbose=True) sys.exit(1 if test_results.failed > 0 else 0) parser = argparse.ArgumentParser() setup_standard_logging_options(parser) parser.add_argument("caseroot", default=os.getcwd(), help="Case directory") # JGF: This doesn't appear to be used anywhere parser.add_argument("bldroot", help="root for building library") parser.add_argument("libroot", help="root for creating the library") args = parser.parse_args() handle_standard_logging_options(args) return args.caseroot, args.libroot, args.bldroot
def parse_input(argv): ############################################################################### parser = argparse.ArgumentParser() setup_standard_logging_options(parser) parser.add_argument("caseroot", default=os.getcwd(), help="Case directory") parser.add_argument("libroot", help="root for creating the library") parser.add_argument("bldroot", help="root for building library") args = parse_args_and_handle_standard_logging_options(argv, parser) # Some compilers have trouble with long include paths, setting # EXEROOT to the relative path from bldroot solves the problem # doing it in the environment means we don't need to change all of # the component buildlib scripts with Case(args.caseroot) as case: os.environ["EXEROOT"] = os.path.relpath(case.get_value("EXEROOT"), args.bldroot) return args.caseroot, args.libroot, args.bldroot
def parse_command_line(args): ############################################################################### parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) utils.setup_standard_logging_options(parser) # Set command line options parser.add_argument( "-cime2file", "--cime2file", help="location of config_grid.xml file in CIME2 format", required=True, ) parser.add_argument( "-cime5file", "--cime5file", help="location of config_grids.xml file in CIME5 format", required=True, ) args = utils.parse_args_and_handle_standard_logging_options(args, parser) if args.cime2file is None or args.cime5file is None: parser.print_help() exit() return args.cime2file, args.cime5file
def parse_input(argv): ############################################################################### parser = argparse.ArgumentParser() setup_standard_logging_options(parser) parser.add_argument("caseroot", default=os.getcwd(), help="Case directory") args = parse_args_and_handle_standard_logging_options(argv, parser) return args.caseroot
def parse_input(argv): ############################################################################### if "--test" in argv: test_results = doctest.testmod(verbose=True) sys.exit(1 if test_results.failed > 0 else 0) parser = argparse.ArgumentParser() setup_standard_logging_options(parser) parser.add_argument("caseroot", default=os.getcwd(), help="Case directory") args = parse_args_and_handle_standard_logging_options(argv, parser) return args.caseroot