When debug_assertions flag is active, properly handles conflicts between
flag subcommands short and long their aliases and args and their
aliases prevents self conflicts where the alias and the flag subcomand
were the same.
Tests to check for conflicts between flag subcommands long and short and
their aliases and args both long and short and their aliases. Tests to
handle self conflicts, where a flag subcommand short or long with have a
corresponding alias with the same value.
No longer abusing external_subcommand, but using subcmd_name in order to
parse a subcommand, added a `keep_state` variable in order to handle the
hacky solution of short command line arguments.
1995: Move to terminal_size dep after the recent textwrap upgrade r=CreepySkeleton a=pksunkara
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
1992: fix(clap_derive): Unwrap `syn::TypeGroup` when checking field types r=CreepySkeleton a=Aaron1011
Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
Due to macro expansions, a `syn` type may be wrapped in multiple
'layers' of `syn::Type::Group`. However, `clap_derive` currently does
not check for `syn::Type::Group`, which will cause an `Option` (along
with other matched types) to fail to be detected when it results from a
macro expansion.
This commit 'unwraps' outer type groups before checking the
user-provided types against well-known types. Currently, these groups
may not be present due to a rustc bug (rust-lang/rust#43081)
However, once https://github.com/rust-lang/rust/pull/73084 is merged,
these groups will be present in more cases. This commit makes `clap`
compatible with both older and newer versions of rustc.
The other examples have `verbosity` as a default arg, and `debug` as a `test` subcommand arg. The macro example has these two switched up -- this corrects that.
1980: Removed word duplicate from docs for allow_hyphen_values r=pksunkara a=kamilogorek
1985: docs(README.md): Fixes typo at line 413 r=CreepySkeleton a=ewilazarus
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
Co-authored-by: Gabriel Lima <ewilazarus@users.noreply.github.com>