cargo clap 2.20.0

latest releases: 4.5.4, 4.5.3, 4.5.2...
7 years ago

New Settings

  • ArgsNegateSubcommands: disables args being allowed between subcommands (5e2af8c9, closes #793)
  • DontCollapseArgsInUsage: disables the collapsing of positional args into [ARGS] in the usage string (c2978afc, closes #769)
  • DisableHelpSubcommand: disables building the help subcommand (a10fc859)
  • AllowMissingPositional: allows one to implement $ prog [optional] <required> style CLIs where the second postional argument is required, but the first is optional (1110fdc7, closes #636)
  • PropagateGlobalValuesDown: automatically propagats global arg's values down through used subcommands (985536c8, closes #694)

API Additions

Arg
  • Arg::value_terminator: adds the ability to terminate multiple values with a given string or char (be64ce0c, closes #782)
  • Arg::default_value_if[s]: adds new methods for conditional default values (such as a particular value from another argument was used) (eb4010e7)
  • Arg::requires_if[s]: adds the ability to conditionally require additional args (such as if a particular value was used) (198449d6)
  • Arg::required_if[s]: adds the ability for an arg to be conditionally required (i.e. "arg X is only required if arg Y was used with value Z") (ee9cfddf)
  • Arg::validator_os: adds ability to validate values which may contain invalid UTF-8 (47232498)
Macros
  • crate_description!: Uses the Cargo.toml description field to fill in the App::about method at compile time (4d9a82db, closes #778)
  • crate_name!: Uses the Cargo.toml name field to fill in the App::new method at compile time (4d9a82db, closes #778)
  • app_from_crate!: Combines crate_version!, crate_name!, crate_description!, and crate_authors! into a single macro call to build a default App instance from the Cargo.toml fields (4d9a82db, closes #778)

Features

  • no_cargo: adds a no_cargo feature to disable Cargo-env-var-dependent macros for those not using cargo to build their crates (#786) (6fdd2f9d)

Bug Fixes

  • Options: fixes a critical bug where options weren't forced to have a value (5a5f2b1e, closes #665)
  • fixes a bug where calling the help of a subcommand wasn't ignoring required args of parent commands (d3d34a2b, closes #789)
  • Help Subcommand: fixes a bug where the help subcommand couldn't be overriden (d34ec3e0, closes #787)
  • Low Index Multiples: fixes a bug which caused combinations of LowIndexMultiples and Arg::allow_hyphen_values to fail parsing (26c670ca)

Improvements

  • Default Values: improves the error message when default values are involved (1f33de54, closes #774)
  • YAML: adds conditional requirements and conditional default values to YAML (9a4df327, closes #764)
  • Support --("some-arg-name") syntax for defining long arg names when using clap_app! macro (f41ec962)
  • Support ("some app name") syntax for defining app names when using clap_app! macro (9895b671, closes #759)
  • Help Wrapping: long app names (with spaces), authors, and descriptions are now wrapped appropriately (ad4691b7, closes #777)

Documentation

  • Conditional Default Values: fixes the failing doc tests of Arg::default_value_ifs (4ef09101)
  • Conditional Requirements: adds docs for Arg::requires_ifs (7f296e29)
  • README.md: fix some typos (f22c21b4)
  • src/app/mod.rs: fix some typos (5c9b0d47)

v2.19.3 (2016-12-28)

Bug Fixes

  • fixes a bug where calling the help of a subcommand wasn't ignoring required args of parent commands (a0ee4993, closes #789)

Don't miss a new clap release

NewReleases is sending notifications on new releases.