Crate argparsnip

Source

Modules§

value

Macros§

arg
Small macro to avoid writing ..Default::default everywhere
args
Small macro to avoid writing ..Default::default everywhere

Structs§

Arg
Struct defining a single arg we can accept
Args
Struct defining the collection of args we support
Filter
A specific combination of args that must be matched in Filters. E.g Filter { args: vec![“foo”, “bar”], filter_type: Any} will pass on foo | bar E.g Filter { args: vec![“foo”, “bar”], filter_type: All} will only pass on foo & bar E.g Filter { args: vec![“foo”, “bar”], filter_type: Any, inverse: true} will pass on foo ^ bar E.g Filter { args: vec![“foo”, “bar”], filter_type: All, inverse: true} will only pass on !(foo & bar)
Filters
Collection of filters used to constrain the combinations of arguments that can be matched. For example, to say we cannot get both args A && B, or we can only be passed C if we’ve also been passed D.
Results
Results object returned by arg parsing (or passed to the handler)

Enums§

Error
FilterType
How to match filters: All -> the filter passes if all are true Any -> the filter passes if any are true
NumValues
The number of values users are able to assign an arg If None we will treat the arg as a flag. This is a special case because if flags are seen multiple times (e.g -vvv) we need to handle that as extra verbose by exposing the number of repetitions. This isn’t needed for normal flags though - just now we overwrite them, but in the future we may move to appending there

Traits§

Handler
IntoStr