Commit graph

6816 commits

Author SHA1 Message Date
Ed Page
c3c9099e72 chore: Release 2022-11-28 21:46:18 -06:00
Ed Page
68127614ec docs: Update changelog 2022-11-28 21:46:04 -06:00
pinkforest(she/her)
2ad0eff495
fix: wasm32 targets with is-terminal (#4518)
Fixes #4510 

Note: `terminal_size` is using old version of rustix and this causes a bit dependency duplication.

Will check to bump upstream. EDIT: Someone already did - https://github.com/eminence/terminal-size/pull/46 (needs a release)
2022-11-28 21:45:10 -06:00
Ed Page
bf39b8d280 docs(ref): Move flatten/subcommand to be under command attr
Fixes #4505
2022-11-28 09:49:15 -06:00
Ed Page
3262016c26 chore: Release 2022-11-24 11:40:15 -06:00
Ed Page
757f95b2e9 docs: Update changelog 2022-11-24 11:39:37 -06:00
Ed Page
20e02eb34e
Merge pull request #4509 from epage/possible
feat: Improve ValueParser experience
2022-11-24 10:06:52 -06:00
Ed Page
fb1d960fe2
Merge pull request #4249 from jcgruenhage/replace-atty
chore: replace atty with is-terminal
2022-11-24 09:48:37 -06:00
Ed Page
94aca92e44 feat: Create ValueParser from Vec<PossibleValue>
This dynamically generated list of possible values.  Inspired by #4504
2022-11-24 09:47:33 -06:00
Ed Page
3bccfced1a docs: Clarify PossibleValue is likely not needed
Fixes #4504
2022-11-24 09:47:33 -06:00
Ed Page
19981a2455 docs: Clarify ColorChoice impls ValueEnum 2022-11-24 09:47:33 -06:00
Ed Page
8d92f3e7a8 feat: Add Display/FromStr to ColorChoice
This matches up with `clap_complete::Shell`.  This makes it a bit more flexible.
2022-11-24 09:47:33 -06:00
Ed Page
ed683ef248 fix: Always expose ColorChoice 2022-11-24 09:47:33 -06:00
Ed Page
789bfd6813
Merge pull request #4508 from epage/style
style: Make clippy happy
2022-11-24 09:38:53 -06:00
Jan Christian Grünhage
aaac3c4930
chore: Replace atty with is-terminal 2022-11-24 15:33:43 +01:00
Ed Page
623ccbc152 style: Make clippy happy 2022-11-24 08:05:21 -06:00
Ed Page
f5dcfc5bd9
Merge pull request #4495 from SUPERCILEX/term-width
Gate term_width and max_term_width APIs on wrap_help
2022-11-21 06:44:04 -06:00
Alex Saveau
fd64c8ae93
Gate term_width and max_term_width APIs on wrap_help 2022-11-20 19:33:02 -08:00
Ed Page
ea99887967
Merge pull request #4492 from WhyNotHugo/update-doc-ref
Update reference to example in docs
2022-11-19 16:49:43 -06:00
Hugo Osvaldo Barrera
d169849330 docs: Clarify mention of example elsewhere
This points to "the example above", but there's no example above when
this gets rendered in docs.rs:

    https://docs.rs/clap_complete/latest/clap_complete/generator/fn.generate.html

I suppose this reference is just stale since moving docs from a single
markdown file or something similar.
2022-11-19 12:22:37 +01:00
Ed Page
44dd8ea4c5 fix: Correctly refer to unstable-v5 2022-11-17 10:09:45 -06:00
Ed Page
2a319d743e
Merge pull request #4488 from epage/pred
fix: Make ArgPredicate non_exhaustive in v5
2022-11-17 09:13:44 -06:00
Ed Page
dd143eed47 fix: Make ArgPredicate non_exhaustive in v5
Didn't want to forget to do this

Inspired by #4487
2022-11-17 09:01:51 -06:00
Ed Page
f8e9211e38 chore: Release 2022-11-16 10:27:26 -06:00
Ed Page
6524416e9e docs: Update changelog 2022-11-16 10:27:20 -06:00
Ed Page
df1efb4c53
Merge pull request #4486 from jpgrayson/master
fix: ContextKind.as_str() spellings
2022-11-16 10:26:28 -06:00
Peter Grayson
d9c9c7bdd8
fix: ContextKind.as_str() spellings
Signed-off-by: Peter Grayson <pete@jpgrayson.net>
2022-11-16 11:14:54 -05:00
Ed Page
ba32ab87b2 chore: Release 2022-11-15 10:41:16 -06:00
Ed Page
391cd0092d docs: Update changelog 2022-11-15 10:41:09 -06:00
Ed Page
8cefdf31cc
Merge pull request #4482 from epage/suggest
feat(parser): Show available subcommands when one is missing
2022-11-15 10:40:16 -06:00
Ed Page
6b62c82fe2 feat(parser): Show available subcommands when one is missing
Similar to
- Listing all required arguments when one is missing
- Listing all possible values when no value is provided

This came up when discussing #3572
2022-11-15 10:18:24 -06:00
Ed Page
d21ee513fd test(parser): Verify subcommand required message 2022-11-15 10:12:05 -06:00
Ed Page
010976c2ff chore: Release 2022-11-14 12:31:29 -06:00
Ed Page
0bafd2f52d docs: Update changelog 2022-11-14 12:31:14 -06:00
Ed Page
8171a5f6d0
Merge pull request #4480 from epage/panic
fix: Don't panic on non-built arg rendering
2022-11-14 12:30:39 -06:00
Ed Page
c939de8a25 fix: Don't panic on non-built arg rendering
For num_args, we'll just use the default

Fixes #4479
2022-11-14 12:13:18 -06:00
Ed Page
95144b7590 chore: Release 2022-11-11 12:47:41 -06:00
Ed Page
20ecae1cb3 docs: Update changelog 2022-11-11 12:47:34 -06:00
Ed Page
e6a3529e24
Merge pull request #4474 from epage/utf8
fix(parser): Don't panic on invalid UTF-8 values
2022-11-11 12:46:02 -06:00
Ed Page
e9cbed34cd fix(parser): Don't panic on invalid UTF-8 values
Fixes #4473
2022-11-11 12:26:04 -06:00
Ed Page
45d26e0013 test(parser): Show UTF8 bug 2022-11-11 12:22:30 -06:00
Ed Page
4d69e56f06
Merge pull request #4471 from epage/assert
test(assert): Verify empty positional assert exists
2022-11-09 22:22:52 -06:00
Ed Page
ec03972023 test(assert): Verify empty positional assert exists
Wondered if we had this for #4467.  Figured we should actually test it.
2022-11-09 22:10:37 -06:00
Ed Page
0d27188d87
Merge pull request #4465 from epage/help
fix(help): Clarify that 'help' command accepts multiple
2022-11-07 23:21:46 -06:00
Ed Page
9376a57d40 fix(help): Clarify that 'help' command accepts multiple
Making this plural can go either way as
- Clarify it is plural
- This is all really to simulate actually doing subcommands and you only
  do one at a time

For now, I lean towards clarifying it is plural

I also tweaked the message to be more consistent with how `--help` and
`-h` describe themselves.

Fixes #4342
2022-11-07 23:04:04 -06:00
Ed Page
6cbe5c4323 chore: Release 2022-11-07 10:47:47 -06:00
Ed Page
d2739c95cf docs: Update changelog 2022-11-07 10:47:40 -06:00
Ed Page
eaa6bfe826
Merge pull request #4463 from epage/help
fix(help): Update auto-next-line to use new padding
2022-11-07 10:46:43 -06:00
Ed Page
dfe9e73880 fix(help): Update auto-next-line to use new padding
In clap v4, we changed the padding from 4 to 2 but we didn't update our
calculation for when to switch to next-line-help as it was a magic
number (we tried to catch all of these).

When updating the tests, we also missed that a test was being wrapped
too narrowly

This was found while discussing #3300
2022-11-07 10:36:51 -06:00
Ed Page
539577dfb2 refactor(help): Remove dead code
`longest` is always the same or longer than the `sc_str.display_width`
2022-11-07 10:27:17 -06:00