StructOpt::from_iter_safe(), which returns an
Errorinstead of killing the program when it fails to parse, or parses one of the short-circuiting flags. (#98 by @quodlibetor)
clapfeatures independently by @Kerollmops
Option(#88) by @Kerollmops
bool(#80) by @TeXitoi
!type (https://github.com/rust-lang/rust/pull/49039#issuecomment-376398999) by @TeXitoi
proc-macro2's nightly feature is enabled. (#77 and proc-macro2#67) by @fitzgen
#![deny(missig_docs](#74) by @TeXitoi
If you are using a
u64 in your struct to get the number of occurence of a flag, you should now add
parse(from_occurrences) on the flag.
#[structopt(short = "v", long = "verbose")] verbose: u64,
must be changed by
#[structopt(short = "v", long = "verbose", parse(from_occurrences))] verbose: u64,
This feature was surprising as shown in #30. Using the
parse feature seems much more natural.
Structopt::from_clapto take its argument by reference by @TeXitoi
There was no reason to take the argument by value. Most of the StructOpt users will not be impacted by this change. If you are using
StructOpt::from_clap, just add a
& before the argument.
StructOpt was quite fuzzy in its attribute parsing: it was only searching for interresting things, e. g. something like
#[structopt(foo(bar))] was accepted but not used. It now fails the compilation.
You should have nothing to do here. This breaking change may highlight some missuse that can be bugs.
In future versions, if there is cases that are not highlighed, they will be considerated as bugs, not breaking changes.
raw()wrapping instead of
_rawsuffixing by @TeXitoi
The syntax of raw attributes is changed to improve the syntax.
You have to change
foo_raw = "bar", baz_raw = "foo" by
raw(foo = "bar", baz = "foo") or
raw(foo = "bar"), raw(baz = "foo").
parse(from_occurrences)parser by @SergioBenitez
StructOpt::from_itermethod by @Kerollmops
_rawsuffix by @Flakebi