Expand description
Argv tokenizer + resolver.
This is the runtime side of #[derive(FdlArgs)]. The derive macro
builds an ArgsSpec from the struct’s fields + attributes, calls
parse on std::env::args(), then destructures the resulting
ParsedArgs into concrete field values.
The parser is opinionated: it does NOT implement every historical convention. What it supports is documented in the test block below, and that set is the contract.
Structs§
- Args
Spec - Declarative spec of what flags and positionals a CLI accepts. Built by
the
#[derive(FdlArgs)]output at runtime, consumed byparse. - Option
Decl - Declaration of a single option (long flag, optionally with short alias).
- Parsed
Args - Intermediate parsed result, shaped for the derive macro’s field extraction. Absence is encoded by a missing map entry.
- Positional
Decl - Declaration of a single positional argument.
Enums§
- Option
State - What happened to a single option on the command line.
Functions§
- parse
- Parse argv against a spec.
args[0]is the program name and is ignored. - suggest
- “Did you mean” suggestion over a fixed candidate list: returns the
first candidate within edit distance 2 of
input, if any. The flag-level equivalent is folded intounknown_long_error; this public entry is for the enum-dispatch codegen, which suggests a subcommand name when the user mistypes one (bin trian→train).