Commit graph

360 commits

Author SHA1 Message Date
Ed Page
d444f46f92 chore: Release 2021-12-08 12:41:59 -06:00
Ed Page
92750c6aa5 docs: Simplify demo 2021-12-07 17:45:57 -06:00
Ed Page
05efe6bcda docs: Add back sponsors 2021-12-07 17:45:57 -06:00
Ed Page
41b8f46b12 docs: Expand breaking change window 2021-12-07 17:45:57 -06:00
Ed Page
7498f676b9 docs: Be explicit about current MSRV 2021-12-07 17:45:57 -06:00
Ed Page
48a5e4931a docs: Note feature needed in demo 2021-12-07 17:45:57 -06:00
Ed Page
3d24b87396 docs: Expand on aspirations 2021-12-06 20:51:24 -06:00
Ed Page
f517c0ede1 docs: Remove author fields 2021-12-06 11:24:23 -06:00
Ed Page
27acb95cd9 docs: Add Derive API reference
I took more inspiration for organization from `serde.rs` than `docs.rs/structopt`.
2021-12-01 21:23:06 -06:00
Ed Page
bbc1d6aff2 docs: Add more crates 2021-12-01 07:15:51 -06:00
Ed Page
befee6667b docs: Re-work examples
This creates distinct tutorial examples from complex feature examples
(more how-tos).  Both sets are getting builder / derive versions (at
least the critical ones).
2021-11-30 21:33:52 -06:00
Ed Page
f890bfa93b docs: Focus top-level README 2021-11-30 09:53:25 -06:00
Ed Page
54228ef7d7 docs: Prefer global_setting
I've been finding I've been setting `AppSettings` without it which is
likely leading to bugs.  This tries to raise the visibility by using it
based on the setting being used and not whether the application needs
it.
2021-11-29 16:10:54 -06:00
Ed Page
c0f0713248 fix!: Lighten clap's default feature set
Too many times people have to disable default features.  Let's try to
have a more minimal out of box experience.

- `derive`: people are already used to adding this feature for serde
- `cargo`: not needed for derive
- `env`: most probably don't use this
- `unicode`: most CLIs are probably ASCII.  We should do a debug warn
  about this though

BREAKING CHANGE: `derive`, `cargo`, `env`, and `unicode` are no longer
on by default.
2021-11-24 10:35:29 -06:00
Mooneyhan
8bc8967498 corrected minor grammar mistakes in README.md (clap-rs/clap#3033) 2021-11-23 13:25:47 -06:00
Ed Page
4c4a2b86a0 refactor: Port over to arg! 2021-11-23 09:37:14 -06:00
Ed Page
6ce9714e2b fix: Deprecate YAML API
Fixes #9
2021-11-22 16:17:46 -06:00
Ed Page
88fff13e71 Revert rename of from_yaml / from_usage
Since usage parser and yaml are on the way to being deprecated (#8, #9),
doing a rename also seems excessive, so rolling it back.

Past relevant PRs:
- clap-rs/clap#1157
- clap-rs/clap#1257
2021-11-22 16:17:46 -06:00
Ed Page
7e899cd340 Revert "Deprecate Arg::help in favour of Arg::about"
This reverts commits 24cb8b1..d0abb37 from clap-rs/clap#1840

This is part of #16.  clap-rs/clap#1840 wasn't the right call but we
don't have time to make the decision now, so instead of having one
option and changing it in 4.0, this reverts back to clap2 behavior.
2021-11-18 12:25:49 -06:00
Ed Page
ff476660ce test: Compile example in README 2021-11-17 21:01:56 -06:00
Ed Page
bfa388420b Put grouped_values_of behind a feature gate
There is enough open work on this, we should probably not have it public
yet, so putting it behind a gate.  See https://github.com/clap-rs/clap/issues/2924
2021-10-26 14:26:50 -05:00
Pavan Kumar Sunkara
585e995811 Release 3.0.0-beta.5 2021-10-17 17:01:18 +01:00
bors[bot]
b835ce9061
Merge #2817
2817: Add support for Multicall executables as subcommands with a Multicall setting r=pksunkara a=fishface60



Co-authored-by: Richard Maw <richard.maw@gmail.com>
2021-10-16 00:32:52 +00:00
Ed Page
61c9e6265b fix(help)!: Merge OPTIONS / FLAGS default groups
For those that want the original behavior, you can usxe
`arg.help_heading(Some("FLAGS"))` on your flags.  Limitations:
- This will not give you a special sort order
- This will not get a `[FLAGS]` added to usage

For templates, we removed `{unified}` and `{flags}`.  To help people
catch these, a debug_assert was added.

I'm unsure but I think there might be a change in behavior in calcuating
when to show `[OPTION]` in usage.  The old code only looked at
`required` while flags looked only at arg groups.  We now look at both.

Ideally we'd add these in `_build` and remove special casing for
no-groups except in the sort order of groups.  I feel like thats best
left for later.

This also reduced the scope of `App`s public API.
`get_*_with_no_heading` seemed a bit specialized to be in the public
API.  #2853 looks at splitting it out into its own PR.

BREAKING CHANGE: Multiple
- `UnifiedHelpMessage` removed
- `{flags}` and `{unified}` are removed and will assert when present.
- `get_*_with_no_heading` removed

Fixes #2807
2021-10-13 11:42:10 -05:00
Pavan Kumar Sunkara
efeb02cd34 fix!: Make color settings an enum 2021-10-13 13:54:44 +01:00
Richard Maw
b808729bbc fixup! Fill in tracking issue number 2021-10-12 20:51:26 +01:00
Richard Maw
b2180e9d72 fixup! Gate Multicall behind unstable feature 2021-10-12 20:35:59 +01:00
Ed Page
0a53fafddf fix: Deprecate Macro API
Fixes #2835
2021-10-11 15:06:38 -05:00
Ed Page
6dd9d467ce fix(help)!: Consoldiate color settings
A lot of users expected `color` feature flag and `ColorAuto` etc to
control all colors.  Having this extra flag around is easy to miss and
adds to our overall settings bloat, making it harder to find settings
people want.

This completely removes it, rather than make it deprecated like
functions in #2617, because there is extra work to mark things
deprecated as Settings and we should decide on our strategy first before
investing time in addressing that issue.

Fixes #2806
2021-10-11 09:01:13 -05:00
bors[bot]
d97c038b1b
Merge #2814
2814: fix(derive)!: Rename `Clap` to `Parser`. r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-10 01:21:47 +00:00
Ed Page
d840d5650e fix(derive)!: Rename Clap to Parser.
Before #2005, `Clap` was a special trait that derived all clap traits it
detected were relevant (including an enum getting both `ArgEnum`,
`Clap`, and `Subcommand`).  Now, we have elevated `Clap`, `Args`,
`Subcommand`, and `ArgEnum` to be user facing but the name `Clap` isn't
very descriptive.

This also helps further clarify the relationships so a crate providing
an item to be `#[clap(flatten)]` or `#[clap(subcommand)]` is more likely
to choose the needed trait to derive.

Also, my proposed fix fo #2785 includes making `App` attributes almost
exclusively for `Clap`.  Clarifying the names/roles will help
communicate this.

For prior discussion, see #2583
2021-10-09 20:12:03 -05:00
Pavan Kumar Sunkara
49aaa5ab0b chore: CI improvements 2021-10-09 19:50:16 +01:00
Ed Page
dfbeb71077 fix: Gate App::replace
We are concerned about the level of polish of this feature and are
unsure enough about its future, we've decided to gate it to unblock the
v3 release.
2021-10-09 10:49:10 -05:00
bors[bot]
5afa640e3b
Merge #2834
2834: fix: Allow unicode-aware case insensitivity with ArgValue r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-09 12:37:33 +00:00
Ed Page
56a6a7418e fix: Allow unicode-aware case insensitivity with ArgValue
This also opens us up to being more unicode aware in other places, like
our sorting of arguments in the help.

Fixes #2792
2021-10-09 07:21:45 -05:00
Ed Page
2bbe9123ee fix!: Generalize unicode feature
This flag was added in v3.  This will allow us to put more related
functionality behind it.

BREAKING CHANGE: `unicode_help` was renamed to `unicode`.
2021-10-09 06:27:28 -05:00
grant0417
f3611ad6b9 feat(generate): Add fig autocomplete generator 2021-10-06 19:42:42 -04:00
Pavan Kumar Sunkara
699a3f76d6 Implement BitOr for settings 2021-09-23 14:57:10 +05:30
Pavan Kumar Sunkara
b8ceab3e6f Fixes #2736 2021-09-04 15:04:09 +05:30
Pavan Kumar Sunkara
52be134949 Release 3.0.0-beta.4
clap@3.0.0-beta.4
clap_derive@3.0.0-beta.4
clap_generate@3.0.0-beta.4

Generated by cargo-workspaces
2021-08-14 23:40:49 +01:00
Pavan Kumar Sunkara
b1752226e2 Fix error 2021-08-14 23:10:05 +01:00
Pavan Kumar Sunkara
73b28fb104 Release 3.0.0-beta.3
clap@3.0.0-beta.3
clap_derive@3.0.0-beta.3
clap_generate@3.0.0-beta.3

Generated by cargo-workspaces
2021-08-14 23:01:13 +01:00
Pavan Kumar Sunkara
c7985fb73e Add env feature gate 2021-08-14 01:55:05 +01:00
Pavan Kumar Sunkara
6994be4f15 Remove doc feature 2021-07-30 22:49:11 +01:00
Ed Page
758e5f337f fix(docs): Ensure examples link works from rustdoc 2021-07-30 10:19:21 +01:00
Ed Page
241d183b9c Bump MSRV to 1.54.0
- This makes it so `doc` compiles on stable

Fixes #2618
2021-07-30 10:19:21 +01:00
patrick-gu
a4dc72ed19 Replace "Prints" with "Print" for default help and version commands 2021-07-29 20:23:25 -07:00
John Breen
a2e5cc2bec
Change some wording to be more inclusive 2021-07-15 17:03:25 -04:00
Kevin Menard
171148873c
Fix a small typo in the README 2021-07-14 17:05:20 -04:00
theidexisted
dd29c3a52c
Simplify example code 2021-07-06 18:00:33 +08:00