def problem_line
cli@0.2.0.0 · cli.bend:6091
import cli@0.2.0.0/cli.bend as Cli
import Base
6091def problem_line(p: Problem) -> String:
6092 match p:
6093 case BadUsage{at, usage, col}:
6094 String.concat([" ", at, ": usage '", usage, "' is invalid at column ",
6095 Nat.show((col + 1n : Nat))])
6096 case BadName{at, name}:
6097 String.concat([" ", at, ": '", name, "' is not a valid name"])
6098 case Dup{at, name}:
6099 String.concat([" ", at, ": '", name, "' is declared more than once"])
6100 case Reserved{at, name}:
6101 String.concat([" ", at, ": '", name, "' is reserved"])
6102 case Misplaced{at, attr}:
6103 String.concat([" ", at, ": '", attr, "' is not allowed here"])
6104 case NoHelp{at, what}:
6105 String.concat([" ", at, ": '", what, "' has no help text"])
6106 case BadDefault{at, id, value}:
6107 String.concat([" ", at, ": '", id, "' cannot have the default '", value,
6108 "'"])
6109 case BadRef{at, id}:
6110 String.concat([" ", at, ": '", id,
6111 "' is an unknown id or an unused or empty group"])
6112 case BadPositional{at, id, why}:
6113 String.concat([" ", at, ": positional '", id, "': ", why])
6114 case Mixed{at}:
6115 String.concat([" ", at, ": has both positionals and subcommands"])
6116 case BadChoices{at, id}:
6117 String.concat([" ", at, ": one_of for '", id,
6118 "' is empty or repeats a value"])
6119 case BadChoice{at, id, value}:
6120 String.concat([" ", at, ": '", id, "' cannot have the choice '", value,
6121 "'"])
6122 case NeedBare{at, id}:
6123 String.concat([" ", at, ": '", id,
6124 "' needs [=<V>] and bare() together, with no short"])
6125 case DecodeBug{at, msg}:
6126 String.concat([" ", at, ": decoder bug: ", msg])