Commit graph

15 commits

Author SHA1 Message Date
Ed Page
6cc76e7237 fix(derive): Clap should not derive ArgEnum
While having convinience derives can be helpful, deriving traits that
are not used in similar situations (`Clap` and `ArgEnum`) can make
things harder
- From a user, derives are opaque and create uncertainty on how to use
  the API if not kept crystal clear (deriving a name gives you the trait
  by that name)
- This makes documentation harder to write and read
- You can use types in unintended places, which is made worse for crate
  APIs because changing this breaks compatibility.

Fixes #2584
2021-07-14 10:50:26 -05:00
Pavan Kumar Sunkara
d6e2246aab Rename setting DisableVersion => DisableVersionFlag 2020-10-24 16:03:12 +02:00
Wim Looman
b31df047b8 Attach validation error as Error::source 2020-10-13 22:13:04 +02:00
Marti Raudsepp
bc7cc4fbab Add examples for using value_hint with clap_derive
Also tweaked clap_generate example a little.
2020-10-10 00:11:44 +03:00
Rémy Greinhofer
2a2cf81977 Update the env var example for derive
Updates the derive example handling environment variables to illustrate
the case where it contains a sensitive value which should not be
displayed on the help screen.

Closes https://github.com/clap-rs/clap/issues/2101
2020-08-23 18:18:25 -05:00
Marti Raudsepp
594c535ba2 Fix various typos in docs & code
Most errors detected and fixed with Topy (https://github.com/intgr/topy),
all verified by hand.
2020-07-19 03:10:28 +03:00
Lane Sawyer
392effe319 fix: Use character instead of string for Arg::Short
This PR switches the Arg::Short macro to take a character instead of a string. It removes the hacky code in the Method to_token method and implements the logic for Short when parsing the clap derive arguments.

Fixes #1815.
2020-06-17 09:45:05 -07:00
Pavan Kumar Sunkara
7bc282dd4e Rename with_name to new for Arg & ArgGroup 2020-05-14 22:50:56 +02:00
creativcoder
92d5920748 Updated test and usage of older help APIs with about 2020-04-27 02:42:07 +05:30
Pavan Kumar Sunkara
dbe6ac01f6 Clean up arg_enum 2020-04-22 14:38:16 +02:00
Pavan Kumar Sunkara
01c179f527 Added arg_enum support 2020-04-22 14:37:45 +02:00
CreepySkeleton
5d9ef1527f Fix warnings in tests & examples 2020-03-05 13:40:25 +03:00
CreepySkeleton
28ef1e91d4
Remove some mentioning of structopt 2020-02-13 18:29:51 +03:00
CreepySkeleton
8221c4f367 Get rid of #[clap(no_version)] 2020-02-05 16:54:58 +03:00
Pavan Kumar Sunkara
5e8f424dfe Merged clap_derive using git-subtree 2020-01-18 17:40:07 +05:30