Commit graph

5898 commits

Author SHA1 Message Date
Ed Page
8a659bc2b4 docs: Update changelog 2022-06-21 09:31:11 -05:00
Ed Page
ceb7ee4f54
Merge pull request #3860 from epage/panic
fix(parser): Don't panic on `--=`
2022-06-21 09:30:19 -05:00
Ed Page
01da890145 fix(parser): Don't panic on --=
This broke when we introduced clap_lex and then did a refactor on top.
We put in guards to say that escapes shouldn't happen but missed `--=`
which isn't quite an escape.

Not fully set on what error should be returned in this case (we are
returning roughly what we used to) but at least
we aren't panicing.

Fixes #3858
2022-06-21 08:53:04 -05:00
Ed Page
dabb5713d4
Merge pull request #3853 from dtolnay-contrib/valuevalidation
Fix typo in ErrorKind::ValueValidation message
2022-06-17 15:39:37 -05:00
David Tolnay
690530a191
Fix typo in ErrorKind::ValueValidation message 2022-06-17 13:07:09 -07:00
Ed Page
ae78f88d48
Merge pull request #3852 from epage/msrv
chore: Bump MSRV from 1.56.0 to 1.56.1
2022-06-17 09:23:06 -05:00
Ed Page
82d70d82c4 chore: Bump MSRV from 1.56.0 to 1.56.1
Being a patch release, I'm fine doing this outside of a minor release.
This avoids us having to deal with indexmap having a higher MSRV.
2022-06-17 09:01:45 -05:00
Ed Page
8c28bec396
Merge pull request #3851 from tshepang/trim-manifest
chore: trim Cargo manifest fields whose values are defaults
2022-06-17 08:59:41 -05:00
Tshepang Mbambo
806f634bfa chore: trim Cargo manifest fields whose values are defaults
See...
- https://doc.rust-lang.org/cargo/reference/manifest.html?#the-documentation-field
- https://doc.rust-lang.org/cargo/reference/manifest.html?#the-readme-field
2022-06-17 15:49:04 +02:00
Ed Page
5fdc26ee9a
Merge pull request #3844 from epage/occurrences
fix(parser): Add value_source as a replacement for occurrences_of
2022-06-16 13:50:17 -05:00
Ed Page
f131d46b99 fix(parser): Add value_source as a replacement for occurrences_of
This was an oversight when listing out the options as identified when
looking at oxidecomputer/humility#161.
2022-06-16 13:29:31 -05:00
Ed Page
48d23b4c02
Merge pull request #3841 from epage/value_hint
test(complete): Ensure we infer path completions from value_parser
2022-06-16 10:28:53 -05:00
Ed Page
ea3bd55993 test(complete): Ensure we infer path completions from value_parser
Looks like I forgot to add a test case for this.

I put this in `clap_complete` because I expect `ValueHint` to move here
as we move towards a plugin system.

Fixes #3840
2022-06-16 09:59:30 -05:00
Ed Page
a7698e9a1d chore: Release 2022-06-15 11:50:16 -05:00
Ed Page
be2a2c050a docs: Update changelog 2022-06-15 11:50:02 -05:00
Ed Page
d5bf866a5d
Merge pull request #3837 from epage/bool
docs: Provide a hybrid-flag example
2022-06-15 11:47:10 -05:00
Ed Page
40daa70b89 docs: Provide a hybrid-flag example
Between
- `ArgAction::SetTrue` storing actual values
- `ArgAction::Set` making it easier for derive users to override bool
  behavior
- `Arg::default_missing_value` allowing hybrid-flags
- This commit documenting hybrid-flags even further

There shouldn't be anything left for #1649

Fixes #1649
2022-06-15 11:09:53 -05:00
Ed Page
c9988db97f docs(builder): Clean up default_missing_value's docs 2022-06-15 10:59:34 -05:00
Ed Page
82fd204ab5
Merge pull request #3836 from epage/help
fix(help): Improve debug output for help
2022-06-15 10:43:06 -05:00
Ed Page
3c9f24ac29
Merge pull request #3834 from omjadas/fix/default-value-os-t
fix: default_value_os_t
2022-06-15 10:07:19 -05:00
Ed Page
eba753f162 fix(help): Further debug clean up 2022-06-15 10:03:52 -05:00
Ed Page
c443aa0b5d refactor(help): Collapse useless function 2022-06-15 09:31:19 -05:00
Ed Page
17d975743a fix(help): Improve debug output 2022-06-15 09:25:18 -05:00
omjadas
4d521429be test: Add test for default_value_os_t 2022-06-15 13:46:59 +10:00
omjadas
b1be436eda fix: Fix compile error caused by default_value_os_t 2022-06-15 13:46:40 +10:00
Ed Page
20358ff295 chore: Release 2022-06-14 15:01:42 -05:00
Ed Page
241a6fcfbc docs: Update changelog 2022-06-14 15:01:19 -05:00
Ed Page
ffd24af5fe
Merge pull request #3832 from epage/derive
fix(derive): Provide derive-friendly deprecation messages
2022-06-14 14:59:56 -05:00
Ed Page
5881bd02ca fix(derive): Provide derive-friendly deprecation messages
This is a step towards #3822.  I'd say this fixes it but I'd want some
user acceptance before doing so.
2022-06-14 14:29:29 -05:00
Ed Page
11fe3ce404 fix(derive): Allow opting in to the original deprecations 2022-06-14 14:26:34 -05:00
Ed Page
ae81b09359 refactor(derive): Split up chained calls 2022-06-14 12:37:21 -05:00
Ed Page
ce5cc92820 refactor(derive): Clarify the kinds of methods 2022-06-14 12:35:19 -05:00
Ed Page
89beb28e73 fix(derive): Reduce amount of deprecation noise
The main thing that might slip through is `bool`.  We'll see if we an
re-introduce that.
2022-06-14 12:24:57 -05:00
Ed Page
63a17a40ad chore: Release 2022-06-14 11:19:59 -05:00
Ed Page
d290f11b8d docs: Update changelog 2022-06-14 11:19:23 -05:00
Ed Page
b619699539
Merge pull request #3830 from epage/deprecate
fix: Allow people to opt-in to deprecations
2022-06-14 11:07:03 -05:00
Ed Page
7515bfeb51 fix: Allow people to opt-in to deprecations
This adds a new `Cargo.toml` feature named `deprecated` that opts
controls whether deprecation warnings show up.  This is starting off as
non-default though that may change (see below).

Benefits
- Allows a staged rollout so a smaller subset of users see new
  deprecations and can report their experience with them before everyone
  sees them.  For example, this reduces the number of people who have to
  deal with #3822.
- This allows people to defer responding to each new batch of
  deprecations and instead do it at once.  This means we should
  reconsider #3616.

The one risk is people who don't follow blog posts and guides having a
harder time upgrading to the next breaking release without the warnings
on by default.  For these users, we reserve the right to make the
`deprecated` feature `default`.  This is most likely to happen in a
minor release that is released in conjunction with the next major
release (e.g. when releasing 4.0.0, we release a 3.3.0 that enables
deprecations by default).  By using a feature, users can still disable
this if they want.

Thanks @joshtriplett for the idea
2022-06-14 10:50:05 -05:00
Ed Page
d71e38ebc2
Merge pull request #3829 from epage/lazy
refactor: Switch to once_cell
2022-06-14 09:44:17 -05:00
Ed Page
cb42df61e4 refactor: Switch to once_cell
Though this is changing an API item we export, we do not consider this a
breaking change because
- This was an implementation detail of the macros and people shouldn't be using it directly
- The `macro_rules` macro is coupled to `clap` because they are in the
  same crate
- The derive macro is coupled to `clap` because `clap` declares a
  `=x.y.z` dependency on `clap_derive

Fixes #3828
2022-06-14 09:10:50 -05:00
Ed Page
b541f2c880 docs(change): Note debug/release assert change 2022-06-14 08:48:36 -05:00
Ed Page
c510c9da19 docs: Put compatibility first in changelog 2022-06-14 08:47:10 -05:00
Ed Page
478609a937 docs: Move item to correct release section 2022-06-14 07:07:10 -05:00
Ed Page
7836beda05 chore: Release 2022-06-14 07:02:40 -05:00
Ed Page
ea09f67666 docs: Go into more details on derive deprecation 2022-06-14 07:01:42 -05:00
Ed Page
a770000e55 docs: Update changelog 2022-06-14 06:49:27 -05:00
Ed Page
4001db6bdf
Merge pull request #3827 from epage/unstable
fix(derive): Switch default action/parser for `unstable-v4`
2022-06-13 20:06:57 -05:00
Ed Page
1ba6ef9080
Merge pull request #3818 from mbhall88/patch-1
docs: update return signature for try_from_os_str
2022-06-13 19:18:39 -05:00
Ed Page
0a529c14cc fix(derive): Switch default actions/parsers for unstable-v4 2022-06-13 18:59:58 -05:00
Ed Page
0c367104ae docs(derive): Update deprecation notice 2022-06-13 18:54:43 -05:00
Michael Hall
52403cd8cc
Update README.md 2022-06-14 09:16:52 +10:00