pub struct Command {
pub raw: String,
pub name: String,
pub primary: Option<String>,
pub args: Vec<Arg>,
pub priority: Priority,
pub urgency: Urgency,
pub verbosity: i8,
pub optional: bool,
pub test_id: Option<u32>,
pub redirect: Option<Redirection>,
pub pipe: Option<Op>,
}Expand description
A single parsed slash command.
§Priority
Inferred from the shape of the raw token before normalization:
| Token shape | Priority |
|---|---|
ALL_CAPS | Max |
TitleCase | High |
camelCase | Medium |
kebab-case | Low |
snake_case | Lowest |
§Suffixes (applied outer → inner)
/TitleCase+++???! → invalid (double ? is an error)
/Deploy?! → name="deploy", optional, urgency=Low
/ALERT!!! → urgency=High
/verbose+++ → verbosity=+3
/quiet-- → verbosity=-2Fields§
§raw: StringThe original token as it appeared in the input (e.g. /Build.flag(v)!).
name: StringNormalized lowercase name (e.g. build).
primary: Option<String>Primary argument from /cmd(value) syntax.
args: Vec<Arg>Builder-chain arguments (e.g. .flag(val).other).
priority: PriorityPriority inferred from the raw token’s casing/separators.
urgency: UrgencyUrgency from trailing ! / !! / !!!.
verbosity: i8Verbosity level from trailing + (positive) or - (negative) markers.
optional: boolWhether the command is optional (? suffix) — its return value may be absent.
test_id: Option<u32>Numeric test identifier for /test-family commands (e.g. /test3 → Some(3)).
redirect: Option<Redirection>Output redirection, if present. Closes the pipeline — no further | is allowed.
pipe: Option<Op>Pipe operator connecting this command to the next one within the same pipeline.