Skip to main content

Module declare

Module declare 

Source
Expand description

How a command declares its place in the command line.

A command’s parameters are already described by the schema it publishes. What a schema cannot know is presentation: that --harness is worth a -H, that agents get reads better with the id as a bare word, that a reader needs two worked examples to choose this command over its neighbour. Those are choices a person makes, so they are declared next to the command rather than inferred from its fields.

Everything here is &'static and const-constructible, so a command declares its route as a constant and the compiler checks it.

Structs§

CliArg
Presentation for one of a command’s parameters.
CliExample
One worked example, declared as an intent and the command line that serves it. See crate::ContractExample for why both halves are required.
CliRoute
Where a command sits in the command line, and how it presents itself.

Functions§

derived_route
The spelling a command gets when it declares no CliRoute.