flatten
by @fbenksteinStructOpt::from_iter_safe()
, which returns an Error
instead of killing the program when it fails to parse, or parses one of the short-circuiting flags. (#98 by @quodlibetor)clap
features independently by @Kerollmopsdefault_value
or required
with Option
(#88) by @Kerollmopsdefault_value
or required
with bool
(#80) by @TeXitoi#[deny(warnings)]
with the !
type (https://github.com/rust-lang/rust/pull/49039#issuecomment-376398999) by @TeXitoiproc-macro2
's nightly feature is enabled. (#77 and proc-macro2#67) by @fitzgen#![deny(missig_docs]
(#74) by @TeXitoiu64
by @SergioBenitezIf 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.
For example
#[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_clap
to take its argument by reference by @TeXitoiThere 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 _raw
suffixing by @TeXitoiThe 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 @SergioBenitezStructOpt::from_iter
method by @Kerollmops&str
or &OsStr
by @kennytm_raw
suffix by @Flakebi