Commit graph

4108 commits

Author SHA1 Message Date
bors[bot]
93decf7424
Merge #2858
2858: Get Fig compiling and testing r=epage a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-12 19:09:52 +00:00
Ed Page
a61752a5d5 chore: Include fig in testing 2021-10-12 11:25:17 -05:00
Ed Page
d8b6016f57 fix(fig): Get tests passing 2021-10-12 11:00:34 -05:00
Ed Page
fa0deb03cf fix(fig): Get compiling 2021-10-12 11:00:34 -05:00
bors[bot]
1f958fab2e
Merge #2849
2849: Parser redux r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-12 15:57:23 +00:00
bors[bot]
36e172672c
Merge #2855
2855: fix(gen)!: Simplify `Generator` trait r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-12 14:50:55 +00:00
Ed Page
536471cb7d fix(gen)!: Simplify Generator trait
This is a followup to #2721 where we decided to remove all of the
helpers from the trait.  They are now in a `utils` mod.  A part of me
wants this module to be private but it'd be a lot to duplicate for the
split out modules.

Note: this doesn't update fig.  Fig was never added to the workspace and
is already broken (and not just from #2721).  My plan is to get this
merged and then fix Fig, rather than fix it in multiple passes.
2021-10-12 08:27:24 -05:00
Ed Page
60c9c2e59a docs(derive): Use more-specific traits
This helps to raise visibility of the new derive traits.

I didn't touch ui tests because there were a lot and they didn't seem to
be as high value.
2021-10-12 07:51:11 -05:00
bors[bot]
ab050441de
Merge #2829
2829: [clap_generate] [zsh] sort out multiple occurrence vs multiple_value. r=pksunkara a=pseyfert



Co-authored-by: Paul Seyfert <Paul.Seyfert@sevensense.ch>
2021-10-12 10:00:06 +00:00
Paul Seyfert
25e337adb1 [clap_generate] [zsh] sort out multiple occurrence vs multiple_value. 2021-10-12 10:48:37 +01:00
bors[bot]
6d046c7aac
Merge #2848
2848: fix: Deprecate Macro API r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-12 07:36:50 +00:00
bors[bot]
404b44837f
Merge #2854
2854: Actually fix the whitespace because it is important r=epage a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2021-10-12 02:33:59 +00:00
Pavan Kumar Sunkara
0a61c8aa08 fix: Whitespace in our generators **is** important and we need to fix it 2021-10-12 02:08:11 +01:00
Pavan Kumar Sunkara
68d0338ddd chore: Minor doc and style changes 2021-10-12 02:08:11 +01:00
bors[bot]
a67aea232d
Merge #2852
2852: fix(help): Show [OPTIONS] with help_heading r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-12 00:55:16 +00:00
Ed Page
350ab9daf7 fix(help): Show [OPTIONS] with help_heading
This was changed in #1989 without an explanation:
- In the help template, there isn't a way to expose with help_headings,
  so show all.
- In usage, we don't know whether the user wants to see `[FLAGS]` /
  `[OPTIONS]` or not, so let's default to showing them.
2021-10-11 19:13:53 -05:00
bors[bot]
74cbe0bf09
Merge #2721
2721: feat(generate): Give `Shell` superpowers to simplify getting started r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-11 23:48:17 +00:00
bors[bot]
c2ebcf1326
Merge #2850
2850: fix: Add test for flattening struct in enum r=epage a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2021-10-11 21:04:34 +00:00
Pavan Kumar Sunkara
685601e002 fix: Add test for flattening struct in enum 2021-10-11 21:54:44 +01:00
Ed Page
0a53fafddf fix: Deprecate Macro API
Fixes #2835
2021-10-11 15:06:38 -05:00
Ed Page
73bc22cc3d docs: Bridge the user to 'Shell'
In addition, this raises the visibility of the new `value_hint` feature.
2021-10-11 10:46:44 -05:00
Ed Page
96f2343e1b feat(generate): 'impl Generator for Shell'
This includes updating the example but does not include improving the
jumping-off documentation.
2021-10-11 10:46:44 -05:00
Ed Page
1bbfd956aa test: Harden tests against trailing whitespace
In a follow up commit, my editor stripped trailing whitespace.  Rather
than have everyone fight this, let's not make a deal over the small
stuff.
2021-10-11 10:44:48 -05:00
Ed Page
35d53d9dcf feat(generate): 'impl ArgEnum for Shell'
These keeps `FromStr` for ease of use with `value_of_t`.

This includes adding test to make sure everything works as expected.
2021-10-11 10:44:48 -05:00
bors[bot]
562e64c723
Merge #2845
2845: fix(help)!: Consoldiate color settings r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-11 14:17:10 +00: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]
a63dcb35b5
Merge #2843
2843: add `App::get_long_about` r=pksunkara a=arxanas



Co-authored-by: Waleed Khan <me@waleedkhan.name>
2021-10-11 09:22:45 +00:00
Waleed Khan
e73ec0887d add App::get_long_about 2021-10-10 17:17:55 -07: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
bors[bot]
8552312fcb
Merge #2841
2841: chore: CI improvements r=epage a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2021-10-09 19:42:41 +00:00
Pavan Kumar Sunkara
49aaa5ab0b chore: CI improvements 2021-10-09 19:50:16 +01:00
bors[bot]
e8ec11e57f
Merge #2837
2837: fix: Gate App::replace r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-09 16:27:41 +00: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]
6919ee51cb
Merge #2831
2831: No empty version r=pksunkara a=kbknapp



Co-authored-by: Kevin K <kbknapp@gmail.com>
2021-10-09 15:21:43 +00:00
Kevin K
7b45695878
breaking(DisableVersionForSubcommands): removed
This commit removes `AppSettings::DisableVersionForSubcommand` as it's
now a moot setting with clap's default functionality of not building a
version flag unless there actually exists version information.

`clap_up` must still be changed to remove this variant instead of the
current configuration to simply rename the variant.
2021-10-09 11:12:50 -04:00
Kevin K
9fbe5841a7
chore: clippy lint fixes 2021-10-09 11:12:50 -04:00
Kevin K
0eba8015e3
chore: silence warning in example code 2021-10-09 11:12:50 -04:00
Kevin K
bb26ed1c8b
imp: adds debug_asserts against generating meaningless flags
This commit adds several debug asserts that ensure the user has not
accidentally generated a version flag that has no information. The
exception to this case is when the user wants to generate a version
flag, but then handle the version display manually. I.e. one can still
generate a "meaningless" version flag, but use
`AppSettings::NoAutoVersion` which is allowed.
2021-10-09 11:12:50 -04:00
Kevin K
07aae5ac54
docs(AppSettings): documents NoAutoHelp and NoAutoVersion
Since these tie in closely with the new default behavior of not
auto-generating the `-V/--version` flags when no information has been provided they are now documented.
2021-10-09 11:12:50 -04:00
Kevin K
14c8850019
tests: fixes test to new default behavior
This commit corrects tests to not expect the `-V,--version` flag when no
version information has been provided.
2021-10-09 11:12:50 -04:00
Kevin K
0addd938a6
tests(Examples): fixes examples for no-auto generated version 2021-10-09 11:06:48 -04:00
Kevin K
7169c47fed
imp(version flag): no longer generates a version unconditionally
This commit changes the default behavior of clap to no longer generate a
`-V, --version` flag when no version information has been provided.

Version information can be provided via `App::version`,
`App::long_version`, or via `App::mut_arg("version", |_| ..)`. Using any
of the above is the only way to have clap auto-generate the version flag.

Technically, clap still generates a version flag, however it is removed
prior to parsing if the user has not provided any version information
via one of the mentioned methods.

Relates to [#2812](https://github.com/clap-rs/clap/issues/2812)
2021-10-09 11:06:48 -04: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
Ed Page
8546f0e348
Merge pull request #2828 from grant0417/master
feat(generate): Add fig autocomplete generator
2021-10-09 05:10:22 -05:00
bors[bot]
dd16fcccc3
Merge #2830
2830: fix(ci): Restore serialization of site deployment r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-08 15:48:11 +00:00
Ed Page
598b87196a fix(ci): Restore serialization of site deployment
When removing `concurrency`, I overlooked this case where we want to
serialize deployments.

Queuing deployments also doesn't give us much.  I switched from using an
action for this to using built-in support.
2021-10-08 09:23:35 -05:00
grant0417
c3b8a96d65 Refactored fig generation code to crate 2021-10-07 20:54:14 -04:00