Skip to main content

Module command

Module command 

Source

Structs§

ArgSpec
Metadata for a single command argument.
CommandMeta
Complete metadata for a command.
Example
An executable example for a command.
FlagSpec
Metadata for a single flag.

Enums§

ArgType
Closed vocabulary for argument value types.
CheckOutcome
Lower-time checking outcome for one positional arg.
FlagValueType
Type of value a flag accepts.
IoDirection
Data direction for an argument.
Stream
Stream type for fallback or default output.

Traits§

CommandSpec
Trait for command metadata and lowering. No execution types.

Functions§

format_duration
Canonical display for a duration: largest exact unit (500ms, 10s, 2m, 1h), falling back to milliseconds. Round-trips through parse_duration.
parse_duration
Parse a TIMEOUT duration token (500ms, 10s, 2m, 1h; a bare number means seconds).
split_assignment
Single-token KEY=value split for direct lower_command callers and exotic keys the grammar cannot classify (single tokens only — no whitespace reassembly, so the quoted-space corruption class cannot arise here). Returns Ok(None) when there is no =.
strip_surrounding_quotes
Strip one layer of surrounding " or ' quotes (both kinds, everywhere).
validate_positionals_against_meta
Validate positional args against a command’s declared specs. Missing required positionals, statically-known type violations, and trailing positionals beyond a fixed-arity spec all fail here; templates, variables, and fragments defer to the runtime resolvers. A trailing Rest spec absorbs any number of positionals.