Ed Page
f9e1ba2c1e
fix(derive): Improve the default span
2022-09-06 07:56:07 -05:00
Ed Page
6648cf6009
refactor(derive): Remove unused Type for values
...
They have no type
2022-09-06 07:55:23 -05:00
Ed Page
f571821670
refactor(derive): Decouple attr and kind processing
2022-09-03 20:58:26 -05:00
Ed Page
9abcae2ac3
refactor(derive): Separate parsing from pushing of attrs
2022-09-03 20:56:33 -05:00
Ed Page
a7ed5d012d
fix(derive): Deprecate using name
for Args
...
The builder function was deprecated in v3 and removed in v4 but the
derive masked that, so we're still adapting things but now with a path
towards removal.
2022-09-02 19:57:37 -05:00
Ed Page
f9ad2c5f09
fix(derive): Guard against invalid attributes
...
We had some guards but this generalizes them and puts them on every
attribute.
2022-09-02 19:26:03 -05:00
Ed Page
707f47f435
fix(derive): Deprecate 'clap' attribute
2022-09-02 15:39:24 -05:00
Ed Page
2609b970a4
refactor(test): Update UI tests to new attributes
2022-09-02 15:23:04 -05:00
Ed Page
e0f2f6fbae
fix(derive): Builder-specialized attributes
2022-09-02 14:06:27 -05:00
Ed Page
dbdd449dc3
refactor(derive): Further generalize kind errors
2022-09-02 14:03:34 -05:00
Ed Page
97ce0c44f7
refactor(derive): Generalize Kind based error checks
2022-09-02 14:03:34 -05:00
Ed Page
59a4578898
refactor(derive): Track the item's Kind
2022-09-02 14:03:34 -05:00
Ed Page
0ae119fda9
fix(derive): Report deprecations for structopt attributes
...
This is more of a test bed for adding new attributes and deprecating
clap ones.
2022-09-02 14:03:31 -05:00
Ed Page
7b0c76de31
Revert "fix(derive): Remove structopt attribute support"
...
This reverts commit 521a012c28
.
2022-09-02 11:15:15 -05:00
Ed Page
7eaa226526
fix(derive): Provide deprecations for bald action/value_parser
...
These will be going away, so we should tell the user.
This is mostly a test bed for our new deprecation plumbing.
2022-09-02 11:14:31 -05:00
Ed Page
edce5c2119
fix(derive): Improve Kind conflict errors
...
This makes it better scale for the future
2022-09-02 10:48:38 -05:00
Ed Page
11ffcf9393
refactor(derive): Determine an Item's Kind first
...
This will allow the attribute processing to change based on the kind
2022-09-02 10:41:34 -05:00
Ed Page
c56277c084
refactor(derive): Make Sp copyable
2022-09-02 10:23:09 -05:00
Ed Page
6d44106e76
fix(derive): Remove helper for removed help_heading
2022-09-02 09:58:08 -05:00
Ed Page
5264a62181
perf(derive): Consolidate field/variant parsing
2022-09-01 13:54:43 -05:00
Ed Page
6e8b366107
perf(derive): Stop generating redundant code
2022-09-01 13:50:27 -05:00
Ed Page
a47462123c
refactor(derive): Only pass around what is needed
2022-09-01 13:21:57 -05:00
Ed Page
a86cb8a26c
refactor(derive): Rely on Self for enums
2022-09-01 12:14:55 -05:00
Ed Page
0b5f95e3a3
perf(derive): Further consolidate parsing of attrs
2022-09-01 12:04:10 -05:00
Ed Page
d8524b5ad1
refactor(derive): Clarify parse is really about attributes
2022-09-01 07:07:19 -05:00
Ed Page
d9844002e5
refactor(derive): Clarify we are dealing with API item
2022-08-31 21:19:26 -05:00
Ed Page
7242e22810
perf(derive): Reduce number of times attributes are parsed
2022-08-31 19:58:14 -05:00
Ed Page
78dc60bd37
refactor(derive): Be explicit in what is being parsed
2022-08-31 10:11:49 -05:00
Ed Page
36460aed08
fix: Deprecate _os variants
...
PR #4096 made them redundant
2022-08-29 12:42:30 -05:00
Ed Page
521a012c28
fix(derive): Remove structopt attribute support
2022-08-26 16:06:10 -05:00
Ed Page
c04fe2fa4b
refactor(derive): Allow carrying context with parsed attributes
2022-08-26 15:52:21 -05:00
Ed Page
f08575e4a3
refactor(derive): Simplify verbatim docs tracking
2022-08-26 14:44:04 -05:00
Ed Page
4e6733fbe5
fix(derive): Remove error case for default_value
2022-08-26 13:59:18 -05:00
Ed Page
b4b121d3a4
fix(derive): Remove deprecated arg_enum attribute
2022-08-26 13:34:16 -05:00
Miguel Fernandez
42cb87b4b6
fix: Amend error message when deriving enums
...
Clarify that only unit variants are fully supported, and that
non-unit variants must be skipped.
2022-08-26 11:08:39 +02:00
Ed Page
276c75cc08
fix: Don't pollute root with str types
2022-08-23 13:12:06 -05:00
Ed Page
1bbf07e574
fix: Prefer more usable &str
for reflection
...
The downside is we can't skip allocations with
- `ValueEnum` default values
- Vaid subcommands
Otherwise, this is a big ergonomic win.
2022-08-22 14:56:16 -05:00
Ed Page
85f541d789
fix: Switch to owned types
...
Impact:
- Binary size: 556.6 KiB to 578.4 KiB
- build time: 6.4950 us (7% slower)
- parse time: 7.7256 us
- parse sc time: 8.1580 us (5% faster)
Fixes #1041
Fixes #2150
2022-08-22 14:55:55 -05:00
Ed Page
8cc164dafb
fix!: Remove lifetime from PossibleValue
...
Another step towards #1041
This isn't the long term type for `PossibleValue::help`, I just wanted
to get the lifetime out of the way first before figuring out how help
will work.
2022-08-19 12:44:29 -05:00
Ed Page
429143af42
fix: Remove once_cell dependency from derive
...
With being able to accept owned types now, `clap_derive` no longer needs
`once_cell` to make dynamic data static.
This helps towards #1365 , #2037
2022-08-16 15:03:35 -05:00
Ed Page
2de59195aa
fix!: Prefer IntoIterator
over &[]
...
The main breakinge change cases:
- `&[char]`: now requires removing `&`
- All other non-ID `&[_]`: hopefully #1041 will make these non-breaking
Fixes #2870
2022-08-15 13:26:17 -05:00
Ed Page
43e961d24f
style: Address clippy
2022-08-11 16:07:58 -05:00
Ed Page
3390adf0d3
chore: Bump MSRV to 1.60.0
...
While at it, this cleans up all of the features. For some reason, I
couldn't do `dep:clap_derive` though.
2022-08-10 21:32:06 -05:00
Daniel Parks
1a2ae76738
fix(derive): Add "id" attribute
...
Previously the Arg id was set with the "name" attribute. This allows use
of an "id" attribute to match the underlying struct.
A side effect of this is that the "id" attribute may also be used on
Commands. This isn't desired, but given the current architecture of the
attribute parser, it's hard to avoid.
Fixes : #3785
2022-08-09 12:15:02 -07:00
Ed Page
ba15b5f430
fix!: Rename Arg::number_of_values to Arg::num_args
2022-08-03 14:45:47 -05:00
Ed Page
470531b515
fix!: Replace multiple_values
with number_of_values
...
This reduces ambiguity in how the different "multiple" parts of the API
interact and lowrs the amount of API surface area users have to dig
through to use clap.
For now, this is only a matter of cleaning up the public API. Cleaning
up the implementation is the next step.
2022-08-01 15:50:23 -05:00
Ed Page
8f6231010a
Merge pull request #4015 from epage/arg_enum
...
fix!: Remove rest of deprecated APIs
2022-08-01 15:34:41 -05:00
Ed Page
76bff6f34e
fix!: Remove rest of deprecated APIs
...
Fixes #4009
2022-08-01 15:21:33 -05:00
dependabot[bot]
44350b376e
chore(deps): bump proc-macro2 from 1.0.40 to 1.0.42
...
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2 ) from 1.0.40 to 1.0.42.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases )
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.40...1.0.42 )
---
updated-dependencies:
- dependency-name: proc-macro2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 07:04:51 +00:00
Ed Page
cf8e1fc319
fix(derive): Make Option<Option<T>>
work per occurrence
2022-07-28 16:52:30 -05:00