18
18
19
19
"""cylc set [OPTIONS] ARGS
20
20
21
- Override task status in a running workflow.
21
+ Override task status in a running workflow by setting outputs (`--out=...`), or
22
+ setting prerequisites and promoting tasks to the active window (`--pre=...`).
22
23
23
- By default (no options) this command sets all required outputs in target tasks.
24
- (Note this won't set the ` succeeded` output if it is not a required output!)
24
+ By default, it sets all required outputs. (Note this won't set the `succeeded`
25
+ output unless succeeded is a required output!)
25
26
26
- With `--pre`, bring tasks into the active window with specified prequisites,
27
- if any, satisfied. This affects task readiness to run. It does not override
28
- clock triggers, xtriggers, or task hold .
27
+ Setting prerequisites contributes to a task's readiness to run. It does not
28
+ override clock triggers, xtriggers, or task hold (in fact these will be
29
+ activated by promoting the task to the scheduler's active window) .
29
30
30
- With `--out`, complete specified outputs. This affects task completion.
31
- It also sets the prerequisites of downstream tasks that depend on those outputs,
32
- and any implied outputs ( started implies submitted; succeeded and failed imply
33
- started; custom outputs and expired do not imply any other outputs) .
31
+ Setting outputs affects task completion, and it sets the prerequisites of
32
+ downstream tasks that depend on those outputs. It also sets implied outputs:
33
+ started implies submitted; succeeded and failed imply started; custom outputs
34
+ and expired do not imply other outputs.
34
35
35
36
Examples:
36
37
37
- Satisfy all required outputs of `3/bar`:
38
- cylc set my-workflow//3/bar
38
+ # satisfy all required outputs of `3/bar`:
39
+ $ cylc set my-workflow//3/bar
39
40
40
- Satisfy the succeeded output of `3/bar`:
41
- cylc set my-workflow//3/bar succeeded
41
+ $ satisfy the succeeded output of `3/bar`:
42
+ # cylc set my-workflow//3/bar succeeded
42
43
43
- Bring `3/bar` to the active window with its dependence on `3/foo` satisfied:
44
- cylc set --pre=3/foo:succeeded my-workflow//3/bar
44
+ # bring `3/bar` to the active window with dependence on `3/foo` satisfied:
45
+ $ cylc set --pre=3/foo:succeeded my-workflow//3/bar
45
46
46
- Bring `3/bar` to the active window with all prerequisites (if any satisfied)
47
- to start checking on clock and xtriggers, and task expiry:
48
-
49
- cylc set --pre=all my-workflow//3/bar
47
+ # bring `3/bar` to the active window with any/all prerequisites satisfied:
48
+ $ cylc set --pre=all my-workflow//3/bar
50
49
51
50
"""
52
51
@@ -117,8 +116,8 @@ def get_option_parser() -> COP:
117
116
help = (
118
117
"Set task prerequisites satisfied."
119
118
" PREREQUISITE format: 'point/task:message'."
120
- " Multiple use allowed, items may be comma separated. See also "
121
- " `cylc trigger` (equivalent to setting all prerequisites) ."
119
+ " Multiple use allowed, items may be comma separated."
120
+ " Use 'all' to satisfy any and all prerequisites."
122
121
),
123
122
action = "append" , default = None , dest = "prerequisites"
124
123
)
@@ -145,8 +144,13 @@ def get_prerequisite_opts(options):
145
144
for p in options .prerequisites :
146
145
result += p .split (',' )
147
146
147
+ if "all" in result :
148
+ if len (result ) != 1 :
149
+ raise InputError ("--pre=all must be used alone" )
150
+ return result
151
+
148
152
for p in result :
149
- if not REC_CLI_PREREQ .match (p ):
153
+ if REC_CLI_PREREQ .match (p ):
150
154
raise InputError (f"Bad prerequisite: { p } " )
151
155
152
156
return result
0 commit comments