mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
Merge pull request #1063 from Eijebong/bitflags
Update bitflags to 1.0 and bump version
This commit is contained in:
commit
53864b5d72
6 changed files with 64 additions and 64 deletions
|
@ -3,10 +3,10 @@ language: rust
|
|||
cache: cargo
|
||||
rust:
|
||||
- nightly
|
||||
- nightly-2017-06-07
|
||||
- nightly-2017-10-11
|
||||
- beta
|
||||
- stable
|
||||
- 1.18.0
|
||||
- 1.20.0
|
||||
matrix:
|
||||
allow_failures:
|
||||
- rust: nightly
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
|
||||
name = "clap"
|
||||
version = "2.27.1"
|
||||
version = "2.27.2"
|
||||
authors = ["Kevin K. <kbknapp@gmail.com>"]
|
||||
exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"]
|
||||
repository = "https://github.com/kbknapp/clap-rs"
|
||||
|
@ -20,7 +20,7 @@ travis-ci = { repository = "kbknapp/clap-rs" }
|
|||
appveyor = { repository = "kbknapp/clap-rs" }
|
||||
|
||||
[dependencies]
|
||||
bitflags = "0.9"
|
||||
bitflags = "1.0"
|
||||
unicode-width = "0.1.4"
|
||||
textwrap = "0.9.0"
|
||||
strsim = { version = "0.6.0", optional = true }
|
||||
|
|
|
@ -60,7 +60,7 @@ impl BitOr for AppFlags {
|
|||
|
||||
impl Default for AppFlags {
|
||||
fn default() -> Self {
|
||||
AppFlags(NEEDS_LONG_VERSION | NEEDS_LONG_HELP | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO)
|
||||
AppFlags(Flags::NEEDS_LONG_VERSION | Flags::NEEDS_LONG_HELP | Flags::NEEDS_SC_HELP | Flags::UTF8_NONE | Flags::COLOR_AUTO)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,46 +69,46 @@ impl AppFlags {
|
|||
pub fn new() -> Self { AppFlags::default() }
|
||||
|
||||
impl_settings! { AppSettings,
|
||||
ArgRequiredElseHelp => A_REQUIRED_ELSE_HELP,
|
||||
ArgsNegateSubcommands => ARGS_NEGATE_SCS,
|
||||
AllowExternalSubcommands => ALLOW_UNK_SC,
|
||||
AllowInvalidUtf8 => UTF8_NONE,
|
||||
AllowLeadingHyphen => LEADING_HYPHEN,
|
||||
AllowNegativeNumbers => ALLOW_NEG_NUMS,
|
||||
AllowMissingPositional => ALLOW_MISSING_POS,
|
||||
ColoredHelp => COLORED_HELP,
|
||||
ColorAlways => COLOR_ALWAYS,
|
||||
ColorAuto => COLOR_AUTO,
|
||||
ColorNever => COLOR_NEVER,
|
||||
DontDelimitTrailingValues => DONT_DELIM_TRAIL,
|
||||
DontCollapseArgsInUsage => DONT_COLLAPSE_ARGS,
|
||||
DeriveDisplayOrder => DERIVE_DISP_ORDER,
|
||||
DisableHelpSubcommand => DISABLE_HELP_SC,
|
||||
DisableVersion => DISABLE_VERSION,
|
||||
GlobalVersion => GLOBAL_VERSION,
|
||||
HidePossibleValuesInHelp => NO_POS_VALUES,
|
||||
Hidden => HIDDEN,
|
||||
LowIndexMultiplePositional => LOW_INDEX_MUL_POS,
|
||||
NeedsLongHelp => NEEDS_LONG_HELP,
|
||||
NeedsLongVersion => NEEDS_LONG_VERSION,
|
||||
NeedsSubcommandHelp => NEEDS_SC_HELP,
|
||||
NoBinaryName => NO_BIN_NAME,
|
||||
PropagateGlobalValuesDown=> PROPAGATE_VALS_DOWN,
|
||||
StrictUtf8 => UTF8_STRICT,
|
||||
SubcommandsNegateReqs => SC_NEGATE_REQS,
|
||||
SubcommandRequired => SC_REQUIRED,
|
||||
SubcommandRequiredElseHelp => SC_REQUIRED_ELSE_HELP,
|
||||
TrailingVarArg => TRAILING_VARARG,
|
||||
UnifiedHelpMessage => UNIFIED_HELP,
|
||||
NextLineHelp => NEXT_LINE_HELP,
|
||||
VersionlessSubcommands => VERSIONLESS_SC,
|
||||
WaitOnError => WAIT_ON_ERROR,
|
||||
TrailingValues => TRAILING_VALUES,
|
||||
ValidNegNumFound => VALID_NEG_NUM_FOUND,
|
||||
Propagated => PROPAGATED,
|
||||
ValidArgFound => VALID_ARG_FOUND,
|
||||
InferSubcommands => INFER_SUBCOMMANDS,
|
||||
ContainsLast => CONTAINS_LAST
|
||||
ArgRequiredElseHelp => Flags::A_REQUIRED_ELSE_HELP,
|
||||
ArgsNegateSubcommands => Flags::ARGS_NEGATE_SCS,
|
||||
AllowExternalSubcommands => Flags::ALLOW_UNK_SC,
|
||||
AllowInvalidUtf8 => Flags::UTF8_NONE,
|
||||
AllowLeadingHyphen => Flags::LEADING_HYPHEN,
|
||||
AllowNegativeNumbers => Flags::ALLOW_NEG_NUMS,
|
||||
AllowMissingPositional => Flags::ALLOW_MISSING_POS,
|
||||
ColoredHelp => Flags::COLORED_HELP,
|
||||
ColorAlways => Flags::COLOR_ALWAYS,
|
||||
ColorAuto => Flags::COLOR_AUTO,
|
||||
ColorNever => Flags::COLOR_NEVER,
|
||||
DontDelimitTrailingValues => Flags::DONT_DELIM_TRAIL,
|
||||
DontCollapseArgsInUsage => Flags::DONT_COLLAPSE_ARGS,
|
||||
DeriveDisplayOrder => Flags::DERIVE_DISP_ORDER,
|
||||
DisableHelpSubcommand => Flags::DISABLE_HELP_SC,
|
||||
DisableVersion => Flags::DISABLE_VERSION,
|
||||
GlobalVersion => Flags::GLOBAL_VERSION,
|
||||
HidePossibleValuesInHelp => Flags::NO_POS_VALUES,
|
||||
Hidden => Flags::HIDDEN,
|
||||
LowIndexMultiplePositional => Flags::LOW_INDEX_MUL_POS,
|
||||
NeedsLongHelp => Flags::NEEDS_LONG_HELP,
|
||||
NeedsLongVersion => Flags::NEEDS_LONG_VERSION,
|
||||
NeedsSubcommandHelp => Flags::NEEDS_SC_HELP,
|
||||
NoBinaryName => Flags::NO_BIN_NAME,
|
||||
PropagateGlobalValuesDown=> Flags::PROPAGATE_VALS_DOWN,
|
||||
StrictUtf8 => Flags::UTF8_STRICT,
|
||||
SubcommandsNegateReqs => Flags::SC_NEGATE_REQS,
|
||||
SubcommandRequired => Flags::SC_REQUIRED,
|
||||
SubcommandRequiredElseHelp => Flags::SC_REQUIRED_ELSE_HELP,
|
||||
TrailingVarArg => Flags::TRAILING_VARARG,
|
||||
UnifiedHelpMessage => Flags::UNIFIED_HELP,
|
||||
NextLineHelp => Flags::NEXT_LINE_HELP,
|
||||
VersionlessSubcommands => Flags::VERSIONLESS_SC,
|
||||
WaitOnError => Flags::WAIT_ON_ERROR,
|
||||
TrailingValues => Flags::TRAILING_VALUES,
|
||||
ValidNegNumFound => Flags::VALID_NEG_NUM_FOUND,
|
||||
Propagated => Flags::PROPAGATED,
|
||||
ValidArgFound => Flags::VALID_ARG_FOUND,
|
||||
InferSubcommands => Flags::INFER_SUBCOMMANDS,
|
||||
ContainsLast => Flags::CONTAINS_LAST
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,27 +32,27 @@ impl ArgFlags {
|
|||
pub fn new() -> Self { ArgFlags::default() }
|
||||
|
||||
impl_settings!{ArgSettings,
|
||||
Required => REQUIRED,
|
||||
Multiple => MULTIPLE,
|
||||
EmptyValues => EMPTY_VALS,
|
||||
Global => GLOBAL,
|
||||
Hidden => HIDDEN,
|
||||
TakesValue => TAKES_VAL,
|
||||
UseValueDelimiter => USE_DELIM,
|
||||
NextLineHelp => NEXT_LINE_HELP,
|
||||
RequiredUnlessAll => R_UNLESS_ALL,
|
||||
RequireDelimiter => REQ_DELIM,
|
||||
ValueDelimiterNotSet => DELIM_NOT_SET,
|
||||
HidePossibleValues => HIDE_POS_VALS,
|
||||
AllowLeadingHyphen => ALLOW_TAC_VALS,
|
||||
RequireEquals => REQUIRE_EQUALS,
|
||||
Last => LAST,
|
||||
HideDefaultValue => HIDE_DEFAULT_VAL
|
||||
Required => Flags::REQUIRED,
|
||||
Multiple => Flags::MULTIPLE,
|
||||
EmptyValues => Flags::EMPTY_VALS,
|
||||
Global => Flags::GLOBAL,
|
||||
Hidden => Flags::HIDDEN,
|
||||
TakesValue => Flags::TAKES_VAL,
|
||||
UseValueDelimiter => Flags::USE_DELIM,
|
||||
NextLineHelp => Flags::NEXT_LINE_HELP,
|
||||
RequiredUnlessAll => Flags::R_UNLESS_ALL,
|
||||
RequireDelimiter => Flags::REQ_DELIM,
|
||||
ValueDelimiterNotSet => Flags::DELIM_NOT_SET,
|
||||
HidePossibleValues => Flags::HIDE_POS_VALS,
|
||||
AllowLeadingHyphen => Flags::ALLOW_TAC_VALS,
|
||||
RequireEquals => Flags::REQUIRE_EQUALS,
|
||||
Last => Flags::LAST,
|
||||
HideDefaultValue => Flags::HIDE_DEFAULT_VAL
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ArgFlags {
|
||||
fn default() -> Self { ArgFlags(EMPTY_VALS | DELIM_NOT_SET) }
|
||||
fn default() -> Self { ArgFlags(Flags::EMPTY_VALS | Flags::DELIM_NOT_SET) }
|
||||
}
|
||||
|
||||
/// Various settings that apply to arguments and may be set, unset, and checked via getter/setter
|
||||
|
|
|
@ -513,7 +513,7 @@
|
|||
//! this repository for more information.
|
||||
|
||||
#![crate_type= "lib"]
|
||||
#![doc(html_root_url = "https://docs.rs/clap/2.27.1")]
|
||||
#![doc(html_root_url = "https://docs.rs/clap/2.27.2")]
|
||||
#![deny(
|
||||
missing_docs,
|
||||
missing_debug_implementations,
|
||||
|
|
|
@ -740,7 +740,7 @@ macro_rules! clap_app {
|
|||
}
|
||||
|
||||
macro_rules! impl_settings {
|
||||
($n:ident, $($v:ident => $c:ident),+) => {
|
||||
($n:ident, $($v:ident => $c:path),+) => {
|
||||
pub fn set(&mut self, s: $n) {
|
||||
match s {
|
||||
$($n::$v => self.0.insert($c)),+
|
||||
|
|
Loading…
Reference in a new issue