Skip to content

Commit

Permalink
Update cylc/flow/scripts/set.py
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Sanders <oliver.sanders@metoffice.gov.uk>
  • Loading branch information
hjoliver and oliver-sanders authored Jan 25, 2024
1 parent 14d767a commit 0ceb438
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions cylc/flow/scripts/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,20 @@ def split_opts(options: List[str]):
>>> split_opts(['a', 'a,b'])
['a', 'b']
# --out=' a '
>>> split_opts([' a '])
['a']
# --out='a, b, c , d'
>>> split_opts(['a, b, c , d'])
['a', 'b', 'c', 'd']
"""
if options is None:
return []
splat = [] # (past tense of split)
for p in options:
splat += p.split(',')
return sorted(set(splat))
return sorted({
item.strip()
for option in (options or [])
for item in option.strip().split(',')
})


def get_prerequisite_opts(prereq_options: List[str]):
Expand Down

0 comments on commit 0ceb438

Please sign in to comment.