Commit graph

447 commits

Author SHA1 Message Date
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
Ed Page
dc035de409 chore: Release 2022-02-01 16:11:53 -06:00
Ed Page
6fa8113168 docs: Update changelog 2022-02-01 16:10:44 -06:00
Ed Page
d2109b3969 chore: Release 2022-01-26 15:54:12 -06:00
Ed Page
f5ae5714bc docs: Update changelog 2022-01-26 15:53:25 -06:00
Ed Page
ea7699c11f chore: Release 2022-01-24 15:34:27 -06:00
Ed Page
d09188a7ce docs: Update changelog 2022-01-24 15:33:12 -06:00
Ed Page
e5b06c3061 chore: Release 2022-01-24 10:54:50 -06:00
Ed Page
ac43b7baee docs: Update changelog 2022-01-24 10:54:04 -06:00
Ed Page
5877f884f1 chore: Release 2022-01-18 14:59:58 -06:00
Ed Page
8cfa3567ef docs: Update changelog 2022-01-18 14:59:48 -06:00
Ed Page
4b60440d91 docs: Note case in #3309 2022-01-18 10:30:51 -06:00
Ed Page
bd1bf66279 chore: Release 2022-01-17 20:34:09 -06:00
Ed Page
4e51f9b0ef docs: Update changelog 2022-01-17 20:33:52 -06:00
Ed Page
ccbbba8908 chore: Release 2022-01-17 09:37:45 -06:00
Ed Page
6817a9cab2 docs: Update changelog 2022-01-17 09:37:22 -06:00
Ed Page
3d8ce3f426 chore: Release 2022-01-12 11:12:42 -06:00
Ed Page
0439dc221f docs: Update changelogs 2022-01-12 11:11:53 -06:00
Ed Page
811fd6a04a chore: Release 2022-01-10 16:16:18 -06:00
Ed Page
29cecfaa5d docs: Update changelog 2022-01-10 16:13:50 -06:00
Ed Page
ef823bbeaf chore: Release 2022-01-05 16:28:24 -06:00
Ed Page
0238a579e1 docs: Update changelog 2022-01-05 16:27:11 -06:00
Ed Page
a61ad342cf docs(changelog): Call out more breaking changes 2022-01-05 10:28:42 -06:00
Ed Page
4ea1965789 chore: Release 2022-01-04 13:07:10 -06:00
Ed Page
c92b91671f docs: Update changelog 2022-01-04 13:07:01 -06:00
Ed Page
9daefba196 chore: Release 2022-01-04 11:42:50 -06:00
Ed Page
6522eb1194 docs: Update changelog 2022-01-04 11:42:35 -06:00
Ed Page
d9906eb150 chore: Release 2022-01-04 09:49:41 -06:00
Ed Page
8830afb6df docs: Update changeog 2022-01-04 09:48:50 -06:00
Ed Page
d392b88bd5 chore: Release 2022-01-03 12:12:28 -06:00
Ed Page
1a19d48765 docs: Update changelog 2022-01-03 12:11:11 -06:00
Ed Page
c01ebbac17 chore: Release 2021-12-31 14:35:02 -06:00
Ed Page
88a335ff97 fix(complete): Give crates more specific names
`clap_generate` originally intended to be "generate anything".  With
`fig`, we already broke one part out.  With #3174's man support, we are
also looking at keeping it separate:
- More freedom to iterate on the API
- Uniqueness (and potential weight) of its dependencies
- man generation is normally more for distribution while completions are
  a mix of being distributed with the app or the app generating the
  completions (which will be exacerbated if we move most completion
  parsing logic to be in Rust)

So `clap_generate` is having a lot more limited of a role than the
original name conveys.   I worry the generic name will be a hindrance to
people discovering and using it (yes, documentation can help but there
are limits).

I hesitated because we are on the verge of releasing 3.0. However, doing
it even later will be even more disruptive because more people will be
using it (crates.io lists ~70 people using `clap_generate`).

To ease things, we are still releasing `clap_generate` as a wrapper
around `clap_complete`.
2021-12-31 12:03:29 -06:00
Ed Page
e5fbdc9b95 Revert "Remove {n} support"
This reverts commit 333b993481.

PR #1810's motivation was effectively "this is redundant with `\n`".
That is a fine motivation.  Unfortunately, we don't have a way to force
a hard break in `clap_derive`.  #2389 should help with this eventually
but we shouldn't hold up 3.0 to get that ready.  So in the mean time, we
are restoring `{n}`.

We have #3230 for tracking the re-removal of it.
2021-12-30 11:44:45 -06:00
Ed Page
3499b6b4b6 docs(changelog): Fix typo 2021-12-23 16:07:29 -06:00
Ed Page
5643dddf3e docs(tutorial): Encourage App::debug_assert 2021-12-23 08:41:52 -06:00
Ed Page
3ae0132f8c docs(changelog): Link out for newline change 2021-12-20 08:38:55 -06:00
Ed Page
95198c95f3 docs: Update changelog 2021-12-15 11:02:12 -06:00
Ed Page
7c10b5a9b4 fix(derive): Treat default_value_os like default_value
The test went from panicing to not-panicing

Fixes #3031
2021-12-13 16:25:49 -06:00
Ed Page
f83ead6a8b docs(change): Update link 2021-12-08 21:03:27 -06:00
Ed Page
ee2d70f8ef docs(change): Fix formatting 2021-12-08 21:01:41 -06:00
Ed Page
b13d66e2d1 docs(change): Fix tag links 2021-12-08 11:49:17 -06:00
Ed Page
90de88e1a3 docs(change): Fix link 2021-12-08 11:48:31 -06:00
Ed Page
b2dc03ec9d docs(change): More consistent formatting 2021-12-08 11:47:39 -06:00
Ed Page
cca6adeedc docs(change): Fix links 2021-12-08 11:45:45 -06:00
Ed Page
5a76a135b2 docs(change): Add v2 changelog
This hasn't been cherry-picked in a while
2021-12-08 11:42:42 -06:00
Ed Page
3fe462c099 docs: Add special note 2021-12-08 11:21:47 -06:00
Ed Page
e5997c1001 docs: Clarify deprecations 2021-12-08 11:14:47 -06:00
Ed Page
4a5d52350e docs: Update old repo location 2021-12-07 08:14:41 -06:00
Ed Page
7dfd1f2e6b docs: Encourage CLI testing 2021-12-06 14:58:56 -06:00
Ed Page
f18f3559e2 docs: Fix example test code 2021-12-06 14:56:45 -06:00
Ed Page
b2836c07a7 fix: Gracefully handle empty authors 2021-12-06 11:30:26 -06:00
Ed Page
4830c75ada docs: Update changelog 2021-12-04 12:07:37 -06:00
Ed Page
951d1fc5c8 doc: Call out release highlights 2021-12-03 20:44:50 -06:00
Ed Page
d2af931c3d doc: Write up migration guide 2021-12-03 20:44:37 -06:00
Ed Page
0cd16c34fc feat: App::debug_assert test helper
This will especially be important for users migrating from clap2 so they
can catch problems earlier in the process.
2021-12-03 14:12:03 -06:00
Ed Page
888c27048d docs: Update changelog 2021-12-02 20:26:21 -06:00
Ed Page
75d417851b docs: Clean up 3.0 changelog 2021-12-02 16:07:43 -06:00
Ed Page
23b988e064 docs: Parent SubcommandPrecedenceOverArg under AppSettings
We have it marked as an `ArgSettings` when it is an `AppSettings`.
2021-11-15 10:27:30 -06:00
rhysd
012f318c97 feat(doc): Fix many typos in docs, comments and codes found by typos-cli 2021-10-19 10:38:22 +09:00