diff --git a/scripts/Tools/case.submit b/scripts/Tools/case.submit index 613cd9410ef..1c0f973354a 100755 --- a/scripts/Tools/case.submit +++ b/scripts/Tools/case.submit @@ -11,7 +11,19 @@ from CIME.case import Case ############################################################################### def parse_command_line(args, description): ############################################################################### - parser = argparse.ArgumentParser(description=description) + parser = argparse.ArgumentParser( + usage="""\n{0} [] [--verbose] +OR +{0} --help +OR +{0} --test +\033[1mEXAMPLES:\033[0m + \033[1;32m# Setup case \033[0m + > {0} +""".format(os.path.basename(args[0], )), + description=description, + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) CIME.utils.setup_standard_logging_options(parser) @@ -45,22 +57,20 @@ def parse_command_line(args, description): CIME.utils.expect(args.prereq is None, "--prereq not currently supported") - CIME.utils.handle_standard_logging_options(args) - - return args + return args.test, args.caseroot, args.job, args.no_batch, args.resubmit, args.skip_preview_namelist, args.batch_args ############################################################################### def _main_func(description): ############################################################################### - args = parse_command_line(sys.argv, description) - if args.test: + test, caseroot, job, no_batch, resubmit, skip_pnl, batch_args = parse_command_line(sys.argv, description) + if test: test_results = doctest.testmod(verbose=True) sys.exit(1 if test_results.failed > 0 else 0) - with Case(args.caseroot, read_only=False) as case: - submit(case, job=args.job, no_batch=args.no_batch, - resubmit=args.resubmit, skip_pnl=args.skip_preview_namelist, - batch_args=args.batch_args) + with Case(caseroot, read_only=False) as case: + submit(case, job=job, no_batch=no_batch, + resubmit=resubmit, skip_pnl=skip_pnl, + batch_args=batch_args) if __name__ == "__main__": _main_func(__doc__) diff --git a/scripts/lib/CIME/XML/env_batch.py b/scripts/lib/CIME/XML/env_batch.py index fdbd2b27ab0..949268c5055 100644 --- a/scripts/lib/CIME/XML/env_batch.py +++ b/scripts/lib/CIME/XML/env_batch.py @@ -362,7 +362,7 @@ def submit_jobs(self, case, no_batch=False, job=None, skip_pnl=False, batch_args jobid = None logger.warn("job is {}".format(job)) - result = self._submit_single_job(case, job, jobid, no_batch=no_batch, skip_pn=skip_pnl, batch_args=batch_args, dry_run=dry_run) + result = self._submit_single_job(case, job, jobid, no_batch=no_batch, skip_pnl=skip_pnl, batch_args=batch_args, dry_run=dry_run) batch_job_id = str(alljobs.index(job)) if dry_run else result depid[job] = batch_job_id jobcmds.append( (job, result) )