clap-rs v3.0.0-beta.4 Release Notes
Release Date: 2021-08-14 // over 2 years ago-
Minimum Required Rust
- ๐ As of this release,
clap
requiresrustc 1.54.0
or greater.
๐ฅ BREAKING CHANGES
โ Added
unicode_help
,env
features.Gated behind
env
:- Arg
Arg::env
Arg::env_os
Arg::hide_env_values
- ArgSettings
ArgSettings::HideEnvValues
โ Removed Methods
- Arg
Arg::settings
in favor ofArg::setting(Setting1 | Setting2)
Arg::multiple
in favour ofArg::multiple_values
andArg::multiple_occurrences
๐ Renamed Settings
AppSettings::DisableHelpFlags
=>AppSettings::DisableHelpFlag
AppSettings::DisableVersion
=>AppSettings::DisableVersionFlag
AppSettings::VersionlessSubcommands
=>AppSettings::DisableVersionForSubcommands
๐ Renamed Variants
- ErrorKind
ErrorKind::MissingArgumentOrSubcommand
=>ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
๐ Changed
AppSettings::StrictUtf8
is now default and it andAppSettings::AllowInvalidUtf8
are replaced byAppSettings::AllowInvalidUtf8ForExternalSubcommands
- This only applies to the subcommand args. Before we paniced if the subcommand itself was invalid but now we will report an error up to the user.
ArgSettings::AllowInvalidUtf8
- Allowing empty values is the default again with
ArgSettings::AllowEmptyValues
changing toArgSettings::ForbidEmptyValues
AppSettings::GlobalVersion
renamed toAppSettings::PropagateVersion
and it is not applied globally anymoreArg::env
,Arg::env_os
,Arg::last
,Arg::require_equals
,Arg::allow_hyphen_values
,Arg::hide_possible_values
,Arg::hide_default_value
,Arg::hide_env_values
,Arg::case_insensitive
andArg::multiple_values
does not setArgSettings::TakesValue
anymoreArg::require_delimiter
does not setArgSettings::TakesValue
andArgSettings::UseValueDelimiter
anymoreArg::require_equals
does not disallow empty values anymoreArg::default_value_if
,Arg::default_value_if_os
,Arg::default_value_ifs
,Arg::default_value_ifs_os
now takes the default value parameter as an optionArg::index
,Arg::number_of_values
,Arg::min_values
,Arg::max_values
now takesusize
Arg::value_delimiter
now acceptschar
instead of&str
ArgMatches::is_present
does not handle subcommand names anymore- Some env var values are considered the same as env var not being present when the arg does not have
ArgSettings::TakesValue
clap_generate::generate_to
now returnsResult<PathBuf, io::Error>
@group
inclap_app!
now needs:
instead of=>
app
andarg
objects inyaml
now allow unknown keys if_has_metadata
is set
๐ Features
- โ Added
clap_generate::Shell
- โ Added Methods
- App
App::license
- Arg
Arg::get_long_about
Arg::get_env
Arg::get_default_values
Arg::hide_env
Arg::required_if_eq_all
Arg::forbid_empty_values
Arg::max_occurrences
- ArgMatches
ArgMatches::grouped_values_of
- Macros
crate_license!
- Error
Error::print
- โ Added Settings
AppSettings::UseLongFormatForHelpSubcommand
AppSettings::IgnoreErrors
AppSettings::InferLongArgs
ArgSettings::HideEnv
โจ Enhancements
- ๐ Better completion scripts
- ๐ Multiple bug fixes, performance improvements and error message improvements
- ๐ As of this release,