From 7de9cddaebd66df23411f5bd88071976957b4f7c Mon Sep 17 00:00:00 2001 From: Andy Salinger Date: Wed, 3 May 2017 17:25:46 -0600 Subject: [PATCH] Make single-dash before multichar arg a warning Moving towards deprecating -multichararg in favor of --multichararg with double dash. This was ignored in the past, and recently made an error in CIME. Backing off to a warning. --- scripts/lib/CIME/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/lib/CIME/utils.py b/scripts/lib/CIME/utils.py index 21bba173d3fd..57a28addbe31 100644 --- a/scripts/lib/CIME/utils.py +++ b/scripts/lib/CIME/utils.py @@ -662,7 +662,7 @@ def parse_args_and_handle_standard_logging_options(args, parser=None): # scripts_regression_tests is the only thing that should pass a None argument in parser if parser is not None: - #_check_for_invalid_args(args[1:]) + _check_for_invalid_args(args[1:]) args = parser.parse_args(args[1:]) # --verbose adds to the message format but does not impact the log level @@ -1241,10 +1241,11 @@ def _check_for_invalid_args(args): if arg.startswith("--"): continue if arg.startswith("-") and len(arg) > 2: - if arg == "-value" or arg == "-noecho": +# Uncomment these lines when we want to enforce --mulitchararg syntax +# if arg == "-value" or arg == "-noecho": logger.warn("This argument is depricated, please use -%s"%arg) - else: - expect(False, "Invalid argument %s\n Multi-character arguments should begin with \"--\" and single character with \"-\"\n Use --help for a complete list of available options"%arg) +# else: +# expect(False, "Invalid argument %s\n Multi-character arguments should begin with \"--\" and single character with \"-\"\n Use --help for a complete list of available options"%arg) class SharedArea(object): """