On this page

0090. Args v1 grammar

Context

The edition plugin set needs a pure, typed CLI parser without adding compiler syntax or capabilities. Generator entry points (ADR-0078) and imports from a generator package runtime (ADR-0084) already provide the required mechanisms. The grammar is a plugin policy and needs an explicit, reproducible v1 default.

Decision

derive Args for Options on a struct generates options_from_args(args: vec<str>) -> result<Options, ArgsError> and options_usage() -> str. The input excludes the executable name. The plugin declares capabilities = []; ArgsError lives in args.rt with a message field.

V1 deliberately excludes short flags, --x=v, subcommands and repeated flags. There is no -- terminator, automatic help flag, implicit process-argument access or option-value escaping convention.

Alternatives

Consequences

Both backends run the same generated Harness parser. Callers control argument acquisition and error presentation. Usage is stable and deliberately compact. Literal values starting -- cannot be supplied in v1. Grammar extensions need a later decision rather than silently changing these defaults.