Commit graph

406 commits

Author SHA1 Message Date
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
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
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
9fb9f563ad docs: Update changelog 2022-07-25 13:31:17 -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
Ed Page
dad2492de0 docs: Note change in derive behavior 2022-07-23 21:24:11 -05:00
Ed Page
08e8642a8c
Merge pull request #3976 from epage/attrib
fix(derive)!: Remove value_parser/action defaulted attributes
2022-07-22 20:25:09 -05:00
Ed Page
6ecb7310a8 fix(derive)!: Remove value_parser/action defaulted attributes 2022-07-22 20:07:47 -05:00
Ed Page
122b562e6b fix!: Change default actions to Set/SetTrue
This is in prep for removing StoreValue/IncOccurrences
2022-07-22 20:00:47 -05:00
Ed Page
11076a5c70 fix(help)!: Make DeriveDisplayOrder the default, removing it
Force sorting with `next_display_order(None)`

Fixes #2808
2022-07-22 15:52:03 -05:00
Ed Page
389ff4ff21 fix(help): Subcommand display order respects Command::next_display_order
Previous behavior:
- They'd be sorted by default
- They'd derive display order if `DeriveDisplayOrder` was set
  - This could be set recursively
- The initial display order value for subcommands was 0

New behavior:
- Sorted order is derived by default
- Sorting is turned on by `cmd.next_display_order(None)`
  - This is not recursive, it must be set on each level
- The display order incrementing is mixed with arguments
  - This does make it slightly more difficult to predict
2022-07-22 15:03:16 -05:00
Ed Page
36dcb05d96 fix!: Change arg! to use ArgAction
Fixes #3795
2022-07-22 13:24:40 -05:00
Ed Page
b77ed545ac fix(env)!: Parse help/version like normal
Fixes #3776
2022-07-22 13:12:12 -05:00
Ed Page
8b064cfee9 fix(derive): Move off of SubcommandRequiredElseHelp
This also let us remove the deprecated attribute

Fixes #3280
2022-07-22 12:33:31 -05:00
Ed Page
0d459128d7 fix(error)!: Merge UnrecognizedSubcommand into InvalidSubcommand
Fixes #3676
2022-07-22 12:12:35 -05:00
Ed Page
a842bd64a0 fix!: Use display_name rather than bin_name in version output 2022-07-22 11:40:30 -05:00
Ed Page
01a3ea425f fix!: Remove unstable-v4 feature gate 2022-07-22 11:34:06 -05:00
Ed Page
16b0362807 fix(error):! Merge EmptyValue into InvalidValue
There isn't a reason to programmatically differentiate them so this
merges them simplify programamtic cases and to hopefully reduce binary
size.
2022-07-22 09:06:01 -05:00
Ed Page
d40e42a9ca chore: Release 2022-07-20 20:13:29 -05:00
Ed Page
88b9406c1b docs: Update changelog 2022-07-20 20:13:20 -05:00
Ed Page
e6b8b4b607 chore: Release 2022-07-19 14:41:47 -05:00
Ed Page
fcd7cae81f docs: Update changelog 2022-07-19 14:39:36 -05:00
Ed Page
a8a7a61f56 chore: Release 2022-07-14 09:38:54 -05:00
Ed Page
ed8837f2cc docs: Update changelog 2022-07-14 09:38:47 -05:00
Ed Page
2df0732df4 chore: Release 2022-07-13 09:08:35 -05:00
Ed Page
1c2242251b docs: Update changelog 2022-07-13 09:08:21 -05:00
Ed Page
9b6321a1f0 chore: Release 2022-07-11 21:48:07 -05:00
Ed Page
096db791bf docs: Update changelog 2022-07-11 21:46:05 -05:00
Ed Page
6614ffa6c8 chore: Release 2022-06-30 08:25:54 -05:00
Ed Page
a67746ecbe docs: Update changelog 2022-06-30 08:25:46 -05:00
Ed Page
b4a1362486 chore: Release 2022-06-28 08:04:18 -05:00
Ed Page
3e80393e43 docs: Update changelog 2022-06-28 08:03:17 -05:00
Ed Page
3823df9bbe chore: Release 2022-06-21 09:32:04 -05:00
Ed Page
8a659bc2b4 docs: Update changelog 2022-06-21 09:31:11 -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
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
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
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
650a29c18b chore: Release 2022-06-13 09:37:47 -05:00
Ed Page
4e56acffce chore: Release 2022-06-13 09:31:29 -05:00
Ed Page
1d053e9b32 docs: Update changelog 2022-06-13 07:48:58 -05:00
Ed Page
97f8041229 fix(assert): Add missing track_caller attributes 2022-06-13 07:04:59 -05:00
Ed Page
9caec5a52d fix(parser): Deprecate ArgMatches::is_present 2022-06-10 14:21:25 -05:00
Ed Page
9b7813558c feat(parser): Provide updated version if 'is_present'
- This matches the more container-like naming we are aiming for
- This provides an opportunity to warn people about moving away from
  `ArgAction::IncOcccurrences` for flags, like the deprecation for
  `ArgMatches::occurrences_of` to help people migrate in preparation for
  clap 4 (rather than having the behavior change subtly in a way only
  caught by thorough tests)

In addition, I feel `contains_id` has less ambiguous meaning than
`is_present`.
2022-06-10 10:16:44 -05:00
Ed Page
31b22d1a51 perf(parser): Take up less memory with ArgAction::Count
Someone should not reasonably expect a coun flag to go up to billions,
millions, or even thousands.  255 should be sufficient for anyone,
right?

The original type was selected to be consistent with
`ArgMatches::occurrences_of` but that is also used for tracking how
many values appear which can be large with `xargs`.

I'm still conflicted on what the "right type" is an wish we could
support any numeric type.  When I did a search on github though, every
case was for debug/quiet flags and only supported 2-3 occurrences,
making a `u8` overkill.

This came out of a discussion on #3792
2022-06-09 11:09:38 -05:00
Ed Page
cb86785c7f docs: Update changelog 2022-06-09 10:47:08 -05:00
Ed Page
588c46b6c6 docs: Update changelog 2022-06-08 15:04:53 -05:00
Ed Page
524e36cf1a chore: Release 2022-05-10 15:29:16 -05:00
Ed Page
6635237037 docs: Update changelog 2022-05-10 15:28:50 -05:00
Ed Page
55e791e80e chore: Release 2022-05-06 11:57:48 -05:00
Ed Page
ed0c01993c docs: Update changelog 2022-05-06 11:57:39 -05:00
Ed Page
17b930c203 chore: Release 2022-05-05 21:04:09 -05:00
Ed Page
e74864994a docs: Update changelog 2022-05-05 20:55:44 -05:00
Ed Page
0240ec5493 chore: Release 2022-05-02 13:02:10 -05:00
Ed Page
5543315d3b docs: Update chaneglog 2022-05-02 13:02:03 -05:00
Ed Page
5e02ac1c19 chore: Release 2022-04-30 20:21:33 -05:00
Ed Page
f7b00adacf docs: Update chaneglog 2022-04-30 20:21:22 -05:00
Ed Page
b01256be36 chore: Release 2022-04-30 06:36:33 -05:00
Ed Page
09d21f4005 docs: Update changelog 2022-04-30 06:35:38 -05:00
Ed Page
0a1cfe3557 docs(changelog): Start v4 section 2022-04-29 08:21:23 -05:00
Ed Page
d805c6031d chore: Release 2022-04-22 06:52:05 -05:00
Ed Page
d09aec2c14 docs: Update changelog 2022-04-22 06:51:59 -05:00
Ed Page
a46ee83224 chore: Release 2022-04-21 20:08:49 -05:00
Ed Page
62e9d2dfe1 docs: Update changelog 2022-04-21 20:08:35 -05:00
Ed Page
0194568b03 chore: Release 2022-04-19 10:31:52 -05:00
Ed Page
62b1e4874a docs: Update changelog 2022-04-19 10:28:28 -05:00
Ed Page
7598c000f9 chore: Release 2022-04-15 14:39:14 -05:00
Ed Page
d05c5dac41 docs: Update changelog 2022-04-15 14:38:58 -05:00
Linda_pp
4626523ca6
docs: Remove unnecessary backtick in changelog 2022-04-08 13:23:24 +09:00
Ed Page
08f74046dc chore: Release 2022-04-01 09:15:32 -05:00
Ed Page
6aa40ad2cb docs: Update changelog 2022-04-01 09:15:18 -05:00
Ed Page
c75d2642ef chore: Release 2022-03-31 12:22:40 -05:00
Ed Page
b774370565 docs: Update changelog 2022-03-31 12:22:13 -05:00
Ed Page
e702f42e5e chore: Release 2022-03-07 10:40:48 -06:00
Ed Page
591a48ff64 docs: Update changelog 2022-03-07 10:40:30 -06:00
Ed Page
e937955efb chore: Release 2022-03-02 09:49:11 -06:00
Ed Page
3ed151d1b3 docs: Update changelog 2022-03-02 09:49:04 -06:00
Ed Page
1e286f3dc2 chore: Release 2022-03-02 09:20:00 -06:00
Ed Page
e0280ca20e docs: Update changelog 2022-03-02 09:19:04 -06:00
Ed Page
63fa59a251 chore: Release 2022-02-28 10:03:45 -06:00
Ed Page
d87dd9005c docs: Update changelog 2022-02-28 10:03:30 -06:00
Ed Page
20dc6673bc chore: Release 2022-02-23 09:39:40 -06:00
Ed Page
2f9cae8cb4 docs: Update changelog 2022-02-23 09:38:44 -06:00
Ed Page
655c3f0b9f chore: Release 2022-02-21 07:50:28 -06:00
Ed Page
5b26c93ddc docs: Update changelog 2022-02-21 07:50:20 -06:00
Vasili Novikov
7a315afc1a
Fix CHANGELOG for structopt migration 2022-02-17 11:18:15 +01:00
Ed Page
e6729f96c3 chore: Release 2022-02-16 11:59:45 -06:00
Ed Page
92d100279f docs(changelog): Add missing deprecation 2022-02-15 11:28:59 -06:00
Ed Page
94c7775a30 docs: Update changelogs 2022-02-15 10:49:00 -06:00
Ed Page
341b12874d docs(faq): Raise visibility of migration guide
Part of #3422
2022-02-08 17:31:16 -06:00