Skip to content

Commit

Permalink
Merge pull request #11 from wxtim/fix.for_Scott_Wales
Browse files Browse the repository at this point in the history
Add a store for CLI variables for reload, which can then be accessed
  • Loading branch information
ScottWales authored Dec 10, 2024
2 parents 2236a70 + 49bf3de commit 257e817
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
20 changes: 15 additions & 5 deletions cylc/flow/scripts/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,26 @@
from cylc.flow.option_parsers import (
WORKFLOW_ID_MULTI_ARG_DOC,
CylcOptionParser as COP,
OptionSettings,
)
from cylc.flow.terminal import cli_function

if TYPE_CHECKING:
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]!,
Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions cylc/flow/scripts/validate_reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -86,6 +87,7 @@
VALIDATE_OPTIONS,
REINSTALL_OPTIONS,
REINSTALL_CYLC_ROSE_OPTIONS,
RELOAD_OPTIONS,
PLAY_OPTIONS,
CYLC_ROSE_OPTIONS,
modify={'cylc-rose': 'validate, install'}
Expand All @@ -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


Expand Down

0 comments on commit 257e817

Please sign in to comment.