def outcome_parse
cli@0.2.0.0 · cli.bend:7673
import cli@0.2.0.0/cli.bend as Cli
import Base
7673def outcome_parse(result: ParseResult, +c: Cmd, h: Host,
7674 +argv: List<&2, String>) -> Outcome:
7675 match result:
7676 case Accepted{+path, fields, external}:
7677 outcome_accepted(builtin_name(sub_at(path, cmd_items(c), None{})), c,
7678 path, fields, external)
7679 case HelpRequested{path, long}:
7680 Shown{0, help_out(term(c, h, argv), view_of(c, path), long), ""}
7681 case VersionRequested{}:
7682 Shown{0, String.concat([cmd_name(c), " ", find_version(cmd_items(c)),
7683 "\n"]), ""}
7684 case SummaryRequired{}:
7685 Shown{2, "", summary_err(term(c, h, argv), view_of(c, []))}
7686 case Rejected{path, fault}:
7687 Shown{2, "", fault_err(term(c, h, argv), fault, c, path, argv)}