Commit graph

4779 commits

Author SHA1 Message Date
Ed Page
0a7e751c21
Merge pull request #3255 from epage/reflect
feat(parser): Allow users to avoid undefined arg asserts
2022-01-04 13:06:01 -06:00
Ed Page
7e4cd43620 feat(parser): Allow users to avoid undefined arg asserts
Cargo is an example of a user that heavily relied on using undefined
names because there is a lot of code sharing between commands.  This
allows a path forward for those users that is just painful enough to
discourage overly relying on it in the future :).
2022-01-04 12:53:03 -06:00
Ed Page
9daefba196 chore: Release 2022-01-04 11:42:50 -06:00
Ed Page
6522eb1194 docs: Update changelog 2022-01-04 11:42:35 -06:00
Ed Page
9e7ee858f1
Merge pull request #3253 from epage/assert
fix: Clarify cause of debug asserts
2022-01-04 11:41:57 -06:00
Ed Page
91de3eb0cd fix: Clarify cause of debug asserts
Ran into one of these being a pain with porting cargo.
2022-01-04 11:30:33 -06:00
Ed Page
d9906eb150 chore: Release 2022-01-04 09:49:41 -06:00
Ed Page
8830afb6df docs: Update changeog 2022-01-04 09:48:50 -06:00
Ed Page
fa5daf4039
Merge pull request #3250 from epage/hyphen
fix(parser): Ignore Last when checking Hyphen Values
2022-01-04 09:46:59 -06:00
Ed Page
453356e044
Merge pull request #3251 from epage/refactor/clippy
refactor: address clippy warnings
2022-01-04 09:38:00 -06:00
Daniel Eades
e8516a9098 style: allow unused field 2022-01-04 09:20:34 -06:00
Daniel Eades
35d7841211 style: simplify boolean expressions 2022-01-04 09:20:30 -06:00
Daniel Eades
e1b21784a0 fix: add 'must_use' attributes to methods returning 'Self' 2022-01-04 09:20:24 -06:00
Daniel Eades
021b1f6997 style: remove useless conversions 2022-01-04 09:20:21 -06:00
Daniel Eades
2986a9eee0 style: remove unnecessary lazy evaluations 2022-01-04 09:20:17 -06:00
Daniel Eades
d6351a7cf3 style: remove 'from_string' call from 'format' args 2022-01-04 09:20:14 -06:00
Daniel Eades
7f71d642cd style: prefer 'char' to 'str' for single character patterns 2022-01-04 09:20:08 -06:00
Ed Page
15704dcaff fix(parser): Ignore Last when checking Hyphe Values
This was found with #3249
2022-01-04 09:16:03 -06:00
Ed Page
e6ee585a4b fix: Clarify short rejection in debug 2022-01-04 09:00:13 -06:00
Ed Page
bcbe126b4d chore: Release 2022-01-03 18:53:28 -06:00
Ed Page
d392b88bd5 chore: Release 2022-01-03 12:12:28 -06:00
Ed Page
1a19d48765 docs: Update changelog 2022-01-03 12:11:11 -06:00
Ed Page
3782d8e728
Merge pull request #3247 from epage/len
fix: Don't panic when getting number of values
2022-01-03 12:08:45 -06:00
Ed Page
5c829ffa58
Merge pull request #3246 from epage/warn
fix(derive): Don't enit warnings
2022-01-03 11:55:16 -06:00
Ed Page
e5806830f3 fix: Don't panic when getting number of values
I was tempted to remove the exact-size nature.  Wouldn't be breaking
since it only panics but decided to go ahead and do this for now.

Fixes #3241
2022-01-03 11:53:59 -06:00
Ed Page
6b9ae5404c fix(derive): Don't enit warnings
We missed covering `Args` warnings when using struct variants.

Fixes #3245
2022-01-03 11:35:34 -06:00
Ed Page
b0cb2057ea docs(derive): Include name magic attribute
Inspired by #3242l
2022-01-03 06:33:53 -06:00
Ed Page
06f24b174a
Merge pull request #3243 from intgr/fix-clap_complete-documentation-imports
docs(complete): Fix imports in documentation
2022-01-03 06:27:04 -06:00
Marti Raudsepp
f10c5d18d9 docs(complete): Fix imports in documentation
Use `shells::Bash` instead of `generators::Bash`
2022-01-02 21:10:18 +02:00
Ed Page
879219a73d
Merge pull request #3240 from epage/heck
chore: Upgrade heck
2022-01-01 21:12:20 -06:00
Ed Page
42f6c72caa chore: Upgrade heck 2022-01-01 20:31:53 -06:00
Ed Page
3bb33387af docs(derive): Remove redundant setting 2022-01-01 19:51:17 -06:00
Ed Page
a01b0c813c chore(gh): Automate release creation 2022-01-01 12:43:24 -06:00
Ed Page
c01ebbac17 chore: Release 2021-12-31 14:35:02 -06:00
Ed Page
bc951e4e53 chore: Release 2021-12-31 13:37:28 -06:00
Ed Page
0aa5fd2e69
Merge pull request #3236 from epage/complete
fix(complete): Better organize the API
2021-12-31 13:36:32 -06:00
Ed Page
19b59a2df8 fix(complete): Better organize the API 2021-12-31 13:25:09 -06:00
Ed Page
8d73a0e80f chore: Release 2021-12-31 12:23:47 -06:00
Ed Page
24a2f3a901
Merge pull request #3235 from epage/complete
fix(complete): Give crates more specific names
2021-12-31 12:22:58 -06:00
Ed Page
88a335ff97 fix(complete): Give crates more specific names
`clap_generate` originally intended to be "generate anything".  With
`fig`, we already broke one part out.  With #3174's man support, we are
also looking at keeping it separate:
- More freedom to iterate on the API
- Uniqueness (and potential weight) of its dependencies
- man generation is normally more for distribution while completions are
  a mix of being distributed with the app or the app generating the
  completions (which will be exacerbated if we move most completion
  parsing logic to be in Rust)

So `clap_generate` is having a lot more limited of a role than the
original name conveys.   I worry the generic name will be a hindrance to
people discovering and using it (yes, documentation can help but there
are limits).

I hesitated because we are on the verge of releasing 3.0. However, doing
it even later will be even more disruptive because more people will be
using it (crates.io lists ~70 people using `clap_generate`).

To ease things, we are still releasing `clap_generate` as a wrapper
around `clap_complete`.
2021-12-31 12:03:29 -06:00
Ed Page
2d7dc1ff8f chore: Release 2021-12-30 15:00:19 -06:00
Ed Page
5360ffad78
Merge pull request #3233 from epage/ref
docs(derive): Link to ref from traits
2021-12-30 14:59:13 -06:00
Ed Page
29d4508e2a docs(derive): Link to ref from traits
This is to help with #3189
2021-12-30 14:41:26 -06:00
Ed Page
ea02f6125d chore: Release 2021-12-30 14:28:32 -06:00
Ed Page
e20c034b23 Merge pull request #3232 from epage/version
fix(help): Prefer short version over long version
2021-12-30 12:41:18 -06:00
Ed Page
889a70ebac fix(help): Prefer short version over long version
When we got #3193, we decided in #3196 that `--help` will give a summary
for other commands (`subcmd --help` in this case) but not show the long
version of the output for that other command.

Now with #3215, I think the case is similar for `--help` not showing the
long version but instead preferring the short version and encouraging
people to run `--version`.

Originally. clap only showed the short version or nothing.  This was
changed in #2369 without fanfare to prefer the long version over short.
Now are we preferring short version over the long version always, just
like all other help.

Fixes #3215
2021-12-30 12:21:19 -06:00
Ed Page
81c636c4b7
Merge pull request #3231 from epage/hardbreak
Revert "Remove {n} support"
2021-12-30 12:14:23 -06:00
Ed Page
e5fbdc9b95 Revert "Remove {n} support"
This reverts commit 333b993481.

PR #1810's motivation was effectively "this is redundant with `\n`".
That is a fine motivation.  Unfortunately, we don't have a way to force
a hard break in `clap_derive`.  #2389 should help with this eventually
but we shouldn't hold up 3.0 to get that ready.  So in the mean time, we
are restoring `{n}`.

We have #3230 for tracking the re-removal of it.
2021-12-30 11:44:45 -06:00
Ed Page
f596bb3ce8 docs(tutorial): Fix another internal link 2021-12-29 18:07:11 -06:00
Ed Page
06866ff1b4
Merge pull request #3229 from emielvanseveren/master
Fix broken internal link
2021-12-29 18:06:32 -06:00