Provides derive(Options) for gumdrop crate
derive(Options)
derive(Options) generates an implementation of the trait Options,
creating an option for each field of the decorated struct.
See the gumdrop documentation for an example
of its usage.
options attribute
Behavior of derive(Options) can be controlled by adding #[options(...)]
attributes to one or more fields within a decorated struct.
Supported items are:
commandindicates that a field represents a subcommand. The field must be of typeOption<T>whereTis a type implementingOptions. Typically, this type is anenumcontaining subcommand option types.command_namewill contain the name of the command selected by the user. Its type must beOption<String>.help_flagmarks an option as a help flag. The field must bebooltype. Options namedhelpwill automatically receive this option.no_help_flagprevents an option from being considered a help flag.countmarks a field as a counter value. The field will be incremented each time the option appears in the arguments, i.e.field += 1;freemarks a field as the free argument container. Non-option arguments will be appended to this field using itspushmethod.short = "?"sets the short option name to the given characterno_shortprevents a short option from being assigned to the fieldlong = "..."sets the long option name to the given stringno_longprevents a long option from being assigned to the fieldhelp = "..."sets help text returned from theOptions::usagemethodmeta = "..."sets the meta variable displayed in usage for options which accept an argument