def parser(self): # Take the command line options from default settings # -> see config module for data types, destination variables, etc. clargs = DefaultCommandLineArguments() # List of command line option required for pre-processor # (argname, argtype (see config module), destination, required flag) options = [ ("-l1p-settings", "l1p-settings", "l1p_settings", True), ("-platform", "platform", "platform", False), ("-source-repo-id", "source-repo-id", "source_repo_id", False), ("-start", "date", "start_date", True), ("-stop", "date", "stop_date", True), ("-exclude-month", "exclude-month", "exclude_month", False), ("-hemisphere", "hemisphere", "hemisphere", False), ("--remove-old", "remove-old", "remove_old", False), ("--no-critical-prompt", "no-critical-prompt", "no_critical_prompt", False), ("--no-overwrite-protection", "no-overwrite-protection", "overwrite_protection", False), ("--overwrite-protection", "overwrite-protection", "overwrite_protection", False)] # create the parser parser = argparse.ArgumentParser() for option in options: argname, argtype, destination, required = option argparse_dict = clargs.get_argparse_dict(argtype, destination, required) parser.add_argument(argname, **argparse_dict) parser.set_defaults(overwrite_protection=False) return parser
def parser(self): # XXX: Move back to caller # Take the command line options from default settings # -> see config module for data types, destination variables, etc. clargs = DefaultCommandLineArguments() # List of command line option required for pre-processor # (argname, argtype (see config module), destination, required flag) options = [("-l2i-product-dir", "l2i-product-dir", "l2i_basedir", True), ("-l3-settings", "l3-settings", "l3_settings", False), ("-l3-griddef", "l3-griddef", "l3_griddef", True), ("-l3-output", "l3-output", "l3_output", True), ("-start", "date", "start_date", True), ("-stop", "date", "stop_date", True), ("-period", "period", "period", False), ("-doi", "doi", "doi", False), ("-data-record-type", "data_record_type", "data_record_type", False), ("--remove-old", "remove-old", "remove_old", False), ("--no-critical-prompt", "no-critical-prompt", "no_critical_prompt", False)] # create the parser parser = argparse.ArgumentParser() for option in options: argname, argtype, destination, required = option argparse_dict = clargs.get_argparse_dict(argtype, destination, required) parser.add_argument(argname, **argparse_dict) return parser
def parser(self): # XXX: Move back to caller # Take the command line options from default settings # -> see config module for data types, destination variables, etc. clargs = DefaultCommandLineArguments() # List of command line option required for pre-processor # (argname, argtype (see config module), destination, required flag) options = [ ("-l2-settings", "l2-settings", "l2_settings", True), ("-run-tag", "run-tag", "run_tag", False), ("-start", "date", "start_date", False), ("-stop", "date", "stop_date", False), ("-l1b-files", "l1b_files", "l1b_files_preset", False), ("-exclude-month", "exclude-month", "exclude_month", False), ("-input-version", "input-version", "input_version", False), ("-l2-output", "l2-output", "l2_output", False), ("--remove-old", "remove-old", "remove_old", False), ("--no-critical-prompt", "no-critical-prompt", "no_critical_prompt", False), ("--no-overwrite-protection", "no-overwrite-protection", "overwrite_protection", False), ("--overwrite-protection", "overwrite-protection", "overwrite_protection", False)] # create the parser parser = argparse.ArgumentParser() for option in options: argname, argtype, destination, required = option argparse_dict = clargs.get_argparse_dict( argtype, destination, required) parser.add_argument(argname, **argparse_dict) parser.set_defaults(overwrite_protection=False) return parser