pub fn outcomes(shell: &str) -> Option<Vec<String>>Expand description
The outcome vocabulary majordomus finish accepts, read out of the shell source that
enforces it.
This is the canonical statement of the set: the case arm in lib/finish.sh is what
actually refuses an unknown outcome, so a drawing derived from anything else — a second
list, a hand-written diagram — can disagree with the tool and look authoritative while
doing it. None when the source carries no vocabulary this can recognise, because a
wrong set silently drawn is worse than no drawing.
use majordomus_cli::diagram::outcomes;
let shell = " case \"$outcome\" in completed|partial|failed) ;;\n";
assert_eq!(outcomes(shell), Some(vec!["completed".into(), "partial".into(), "failed".into()]));
assert_eq!(outcomes("nothing of the sort"), None);