Commit graph

6073 commits

Author SHA1 Message Date
Ed Page
630a4894b3 fix(error): Ensure empty possible values isn't shown 2022-07-28 16:48:47 -05:00
Ed Page
81faa8b34b
Merge pull request #4000 from epage/missing
fix(parser): Rely on default_missing_value for flag actions
2022-07-28 15:56:05 -05:00
Ed Page
8e20782bfd fix(parser): Rely on default_missing_value for flag actions
In the short term, this just provides a back door to custom actions.
Longer term, we can explore a `SetConst` action that relies on this
behavior.  Really, `SetTrue` and `SetFalse` are shortcuts for such an
action but shortcuts can be helpful for usability.

Apparently, this also reduced `.text` size by 1k
2022-07-28 15:43:08 -05:00
Ed Page
f76a867e3f fix: Simplify flag parsing
Multiple values can only happen from env variables when configured by
the user, so let's not go out of our way to deal with it.
2022-07-28 15:31:40 -05:00
Ed Page
4887695aca
Merge pull request #3999 from epage/usage
fix: Misc clean up in prep for #2688
2022-07-28 15:25:45 -05:00
Ed Page
8aa960c984 style: Make clippy happy 2022-07-28 15:11:28 -05:00
Ed Page
c2f5d8d7b7 perf: Reduce amount of code for rendering args
Rendering of usage is not in a critical path, so should be more worried
about binary size than performance.  That only leaves avoiding coloring
spaces.  That shouldn't be a problem, so let's make the binary smaller.
2022-07-28 14:56:33 -05:00
Ed Page
a7a96e02fa refactor(help): Simplify rendering of arg values 2022-07-28 14:46:19 -05:00
Ed Page
355a8ff90c fix!: number_of_values doesn't always imply multiple_values(true)
With `number_of_values` being per-occurrence now, its doesn't make sense
for `number_of_values(0)` to set `takes_value(true)` or for
`number_of_values(1)` to set `multiple_values(true)`.

In addition, an assert is made if the user works around this
2022-07-28 14:40:58 -05:00
Ed Page
2be2924f91 test(help): Veriy rendering of min_values 2022-07-28 13:33:42 -05:00
Ed Page
ef9d582464 refactor(test): Consolidate number_of_values tests 2022-07-28 13:28:39 -05:00
Ed Page
15d7f51e88 test(macros): Port optional-value test from derive to arg 2022-07-28 13:27:28 -05:00
Ed Page
5eedb03e45 fix(help): Mark positionals as optional 2022-07-28 13:12:26 -05:00
Ed Page
43aa695ad7 refactor: Abstract access to min_vals 2022-07-28 13:12:18 -05:00
Ed Page
6e9250d4ab chore: Remove dead test file 2022-07-28 12:17:22 -05:00
Ed Page
11883b6fbc fix: Remove unused schema 2022-07-28 12:11:35 -05:00
Ed Page
586b49a43c
Merge pull request #3998 from epage/missing
fix(parser)!: Apply default_missing_value per occurrence
2022-07-27 20:58:56 -05:00
Ed Page
67adc4acf9 fix(parser)!: Apply default_missing_value per occurrence
This both simplifies the code and the model we present to the user,
making more sense.

There is room for further exploration of tying flag actions into this.
2022-07-27 20:23:58 -05:00
Ed Page
ee06707c90
Merge pull request #3992 from epage/action
docs: Shift focus from takes_value to actions
2022-07-26 15:45:18 -05:00
Ed Page
5f20fe1930 docs: Shift focus from takes_value to actions 2022-07-26 14:50:51 -05:00
Ed Page
8e9c4c6c64 fix: Be explicit on help/version action 2022-07-26 09:34:23 -05:00
Ed Page
55f2bb6979
Merge pull request #3991 from epage/warn
chore: Fix warnings
2022-07-25 14:58:54 -05:00
Ed Page
62c75a001b
Merge pull request #3990 from epage/external
fix!: Use value parsers for external subcommands
2022-07-25 14:46:27 -05:00
Ed Page
095d7db33e chore: Fix warnings 2022-07-25 14:35:23 -05:00
Ed Page
8ea1e2d4d3 fix!: Use value parsers for external subcommands
This changes the default type as well to encourage preserving the full
information for shelling out.  If people need UTF-8, then they can
change the value parser.

Fixes #3733
2022-07-25 14:31:56 -05:00
Ed Page
2d469511f9
Merge pull request #3989 from epage/dupe
fix(assert)!: Prevent repeated subcommand names
2022-07-25 14:18:10 -05:00
Ed Page
475a0fc0a2 fix!: Remove PartialEq from Command
This gives us more implementation flexibility
2022-07-25 13:52:13 -05:00
Ed Page
13e672fb90 fix(assert)!: Prevent repeated subcommand names
Fixes #3888
2022-07-25 13:46:18 -05:00
Ed Page
3610a14e9e
Merge pull request #3988 from epage/occur
fix!: Remove multiple occurrences in favor of Append/Count
2022-07-25 13:45:47 -05:00
Ed Page
76c47f66e2 chore: Allow releasing from release branches 2022-07-25 13:31:25 -05:00
Ed Page
9fb9f563ad docs: Update changelog 2022-07-25 13:31:17 -05:00
Ed Page
6f03b4f948 fix!: Remove multiple occurrences in favor of Append/Count
For num_vals and friends, this only implements hacks until #2688

Fixes #3021
2022-07-25 13:23:43 -05:00
Ed Page
8c7fe8bb2f
Merge pull request #3986 from epage/override
fix(assert)!: Disallow self-overrides
2022-07-25 12:58:59 -05:00
Ed Page
b47a8453d7
Merge pull request #3933 from emersonford/vec-value-enum-default-value-t
feat(clap_derive): Add `default_values_t` and `default_values_os_t` for Vec field types
2022-07-25 12:54:43 -05:00
Ed Page
ec38212dcb fix(assert)!: Disallow self-overrides
This will make it easier to drop support for multiple occurrences
2022-07-25 12:46:16 -05:00
Ed Page
5a8e2046af fix(assert)!: Ensure overrides_with IDs are valid 2022-07-25 12:26:32 -05:00
Emerson Ford
04e0ed7474 feat(clap_derive): Add default_values_t and default_values_os_t 2022-07-25 10:14:04 -07:00
Ed Page
fe6c0a509e
Merge pull request #3985 from tshepang/master
docs: Remove extraneous words
2022-07-25 09:20:34 -05:00
Tshepang Mbambo
2facce8301 docs: Remove extraneous words 2022-07-25 15:47:49 +02:00
Ed Page
8e0d6b011a
Merge pull request #3983 from tshepang/master
docs: typo
2022-07-25 08:01:45 -05:00
Tshepang Mbambo
ec9dcaaf16 docs: Fix a typo 2022-07-24 16:00:59 +02:00
Ed Page
732a21b1bf test: Make version agnostic 2022-07-23 21:55:30 -05:00
Ed Page
a8881dfdba
Merge pull request #3982 from epage/ver
chore: Update version
2022-07-23 21:47:40 -05:00
Ed Page
8aa7ab3e16 chore: Update version
The main goal is to reduce the risk of people developing on the wrong
release, assuming they are using something like starship to raise the
visibility of the crate version.
2022-07-23 21:43:37 -05:00
Ed Page
ae35ff12ff
Merge pull request #3981 from epage/dep
fix!: Remove more deprecated APIs
2022-07-23 21:37:51 -05:00
Ed Page
dad2492de0 docs: Note change in derive behavior 2022-07-23 21:24:11 -05:00
Ed Page
a3356aae43 fix!: Remove more deprecated APIs 2022-07-23 21:23:06 -05:00
Ed Page
0eaec6085a
Merge pull request #3978 from epage/perf
perf: Remove some monomorphization bloat
2022-07-23 21:17:07 -05:00
Ed Page
7518332e56
Merge pull request #3979 from Lioness100/patch-1
docs: Remove extra bracket typo
2022-07-23 11:53:11 -05:00
Lioness100
304297e5c8
docs: remove extra bracket typo 2022-07-23 08:23:11 -07:00