diff --git a/cylc/flow/scripts/reload.py b/cylc/flow/scripts/reload.py index 1d1b89ed99..c8e39989d1 100755 --- a/cylc/flow/scripts/reload.py +++ b/cylc/flow/scripts/reload.py @@ -60,6 +60,7 @@ from cylc.flow.option_parsers import ( WORKFLOW_ID_MULTI_ARG_DOC, CylcOptionParser as COP, + OptionSettings, ) from cylc.flow.terminal import cli_function @@ -67,6 +68,18 @@ from optparse import Values +RELOAD_OPTIONS = [ + OptionSettings( + ['-g', '--global'], + help='also reload global configuration.', + action="store_true", + default=False, + dest="reload_global", + sources={'reload'} + ), +] + + MUTATION = ''' mutation ( $wFlows: [WorkflowID]!, @@ -89,11 +102,8 @@ def get_option_parser(): multiworkflow=True, argdoc=[WORKFLOW_ID_MULTI_ARG_DOC], ) - - parser.add_option( - "-g", "--global", - help="also reload global configuration.", - action="store_true", default=False, dest="reload_global") + for option in RELOAD_OPTIONS: + parser.add_option(*option.args, **option.kwargs) return parser diff --git a/cylc/flow/scripts/validate_reinstall.py b/cylc/flow/scripts/validate_reinstall.py index 4e78d673d7..afb36ddeab 100644 --- a/cylc/flow/scripts/validate_reinstall.py +++ b/cylc/flow/scripts/validate_reinstall.py @@ -73,6 +73,7 @@ reinstall_cli as cylc_reinstall, ) from cylc.flow.scripts.reload import ( + RELOAD_OPTIONS, run as cylc_reload ) from cylc.flow.terminal import cli_function @@ -86,6 +87,7 @@ VALIDATE_OPTIONS, REINSTALL_OPTIONS, REINSTALL_CYLC_ROSE_OPTIONS, + RELOAD_OPTIONS, PLAY_OPTIONS, CYLC_ROSE_OPTIONS, modify={'cylc-rose': 'validate, install'} @@ -102,6 +104,7 @@ def get_option_parser() -> COP: for option in VR_OPTIONS: parser.add_option(*option.args, **option.kwargs) parser.set_defaults(is_validate=True) + return parser