Commit graph

5194 commits

Author SHA1 Message Date
Ed Page
81092b5aed fix: Detect deeply recursed global args
Fixes #3428
2022-02-09 16:05:27 -06:00
Ed Page
82dfc7d5ea perf: Reduce parse allocations 2022-02-09 15:24:52 -06:00
Ed Page
117c9edb6e
Merge pull request #3427 from epage/example
docs(tutorial): Demonstrate custom parsing
2022-02-09 10:05:20 -06:00
josh rotenberg
ee3eab1614 docs(tutorial): Demonstrate custom parsing
Adds a more in depth validator to validate that the port is in range in the derive and builder tutorial (section 4.2).

This supersedes #3416
2022-02-09 09:16:57 -06:00
Ed Page
1b5f9e6450
Merge pull request #3425 from epage/help
fix(assert): Provide next steps for '-h' conflicts
2022-02-08 19:16:03 -06:00
Ed Page
6c60b79d21 fix(assert): Provide next steps for '-h' conflicts
For now, we are going to provide a better debug assert in this case.
Resolving #3405 is the better long term route.

Fixes #3403
2022-02-08 18:56:14 -06:00
Ed Page
df1d50c367 fix: Easier to debug help flags 2022-02-08 18:51:51 -06:00
Ed Page
0aabcd70c1 test: Ensure we can avoid a short on help 2022-02-08 18:51:51 -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
62759ffea7
Merge pull request #3424 from epage/source
feat(parser): Expose ValueSource
2022-02-08 15:22:55 -06:00
Ed Page
12c29526fa fix(parser): Give room for more ValueSources 2022-02-08 15:05:59 -06:00
Ed Page
f42fc89288 fix(parser): Remove an internal-only ValueSource 2022-02-08 15:05:59 -06:00
Ed Page
edda56f072 feat(parser): Expose ValueSource
Fixes #1345
2022-02-08 15:05:51 -06:00
Ed Page
31bd34ca1a
Merge pull request #3423 from epage/assert
fix(assert): Report invalid defaults in debug asserts
2022-02-08 15:01:42 -06:00
Ed Page
9f41bb3948 fix(assert): Report invalid defaults in debug asserts
This can help people catch them via `App::debug_assert` rather than
waiting until the default is used and validated.

Fixes #3202
2022-02-08 14:41:33 -06:00
Ed Page
edf9d057c4
Merge pull request #3421 from epage/more
fix(help): ArgsRequiredElseHelp should ignore defaults
2022-02-08 14:23:35 -06:00
Ed Page
15f01789d2
Merge pull request #3420 from epage/default
Requires and Conflicts should ignore default_value
2022-02-08 12:59:20 -06:00
Ed Page
b2d1ebef4b fix(help): ArgsRequiredElseHelp should ignore defaults
Fixes #1264
2022-02-08 12:34:19 -06:00
Ed Page
25b8fe8edb Revert "Revert "Revert "Revert "docs: Clarify corner caseses with default values""""
This reverts commit 26bbe606d3.
2022-02-08 12:27:52 -06:00
Ed Page
d3b084926a test(validate): Ensure defaults are ignored 2022-02-08 12:27:40 -06:00
Ed Page
e87881f91a fix(validate): Limit relationship checks to non-defaults 2022-02-08 12:17:39 -06:00
Ed Page
f59c82bc1d refactor(validate): Clarify intent of code 2022-02-08 11:52:07 -06:00
Ed Page
279e39a858 fix(validate): Only check requires when target is set by user
Unrolling serves two distinct purposes but we muddied them together
- Is `requires` satisfied for validation
- Report what arguments are currently considered required for usage

This was split out of #3020
2022-02-08 11:24:47 -06:00
Ed Page
135b15467e chore: Release 2022-02-08 10:28:40 -06:00
Ed Page
1330a46bf0 docs: Update changelog 2022-02-08 10:28:27 -06:00
Ed Page
fc0eeb28bb
Merge pull request #3419 from epage/man
docs(man): Add some basic documentation
2022-02-08 10:25:24 -06:00
Ed Page
6cd069ab5d docs: Expand doc comments 2022-02-08 10:10:22 -06:00
Ed Page
c5080f1139 docs(man): Fill our README 2022-02-08 09:59:57 -06:00
Ed Page
f1980313bf
Merge pull request #3417 from alerque/repo-config
chore(gh): Update list of crates in scope of issue tracker
2022-02-08 08:16:45 -06:00
Ed Page
2b265ea81a fix(validate): Only check if value is set by user
This was split out of #3020
2022-02-08 08:12:39 -06:00
Ed Page
f830bf93b0 refactor(validate): Generalize contains_explicit 2022-02-08 08:11:46 -06:00
Caleb Maclennan
3e1c819b8a
chore(gh): Update list of crates in scope of issue tracker 2022-02-08 16:57:45 +03:00
Ed Page
3a517b6583 refactor(validate): Centralize all required logic 2022-02-08 07:34:11 -06:00
Ed Page
06b6714a48 docs(contrib): Call out parallel tutorials 2022-02-08 07:08:14 -06:00
Ed Page
155a28f257 docs: Link out to clap_mangen 2022-02-07 21:40:04 -06:00
Ed Page
c65b9f07e0
Merge pull request #3415 from epage/man
fix(man): Rename crate to match style
2022-02-07 21:22:55 -06:00
Ed Page
86bf680645 fix(man): Rename crate to match style
I have access to the `clap-man` name but we use `clap_*`.  Rather than
people getting mixed up on which is supposed to use, we went with a
different name.
2022-02-07 20:20:01 -06:00
Ed Page
b0199dc297
Merge pull request #3414 from epage/todo
feat: Help Heading and Display Order work in prep for deprecations
2022-02-07 19:58:15 -06:00
Ed Page
6ad52f41b3 feat: Allow disabling derive display order
In clap 4.0, we will make `DeriveDisplayOrder` the default and this is
how you'll disable it.

This is part of #2808
2022-02-07 19:19:11 -06:00
Ed Page
5290f82133 feat: Override DeriveDisplayOrder behavior with App::next_display_order
For the derive API, you can only call `next_display_order` when dealing
with a flatten.  Until we offer app attributes on arguments, the user can workaround with
this no-op flattens.

This is a part of #1807
2022-02-07 19:19:11 -06:00
Ed Page
16bf834aa5 refactor: Prepare for overriding derived display order 2022-02-07 19:19:11 -06:00
Ed Page
c00f71ec4a feat: Add App::next_help_heading
This clarifies the intent and prepares for other functions doing the
same, like `next_display_order`.  This will then open us to name
`subcommand_help_heading` and `display_order` similar.

The deprecation is waiting on 3.1.

This is part of #1807 and #1553.
2022-02-07 19:19:01 -06:00
Ed Page
4f50e97f23 docs: Prepare for 3.1 deprecations
Don't want to forget this remaining work
2022-02-07 19:17:09 -06:00
Ed Page
6bfe7f5a0b
Merge pull request #3402 from epage/context
feat(error): Expose error building blocks
2022-02-07 15:37:27 -06:00
Ed Page
07e4e424ac perf(error): Take arond 5kb off 2022-02-07 14:55:24 -06:00
Ed Page
e3e0a91561 fix(error): Don't overload fields 2022-02-07 14:47:49 -06:00
Ed Page
0dfdeb07bc test: Update 2022-02-07 13:28:48 -06:00
Ed Page
84416b267c style: Make clippy happy 2022-02-07 13:06:04 -06:00
Ed Page
600d741d65 feat(error: Expose unknown-argument context 2022-02-07 13:03:23 -06:00
Ed Page
6079bae959 perf: Reduce binary size by 11k 2022-02-07 12:35:23 -06:00