Commit graph

6533 commits

Author SHA1 Message Date
Ed Page
69c2d65ca9
docs(contrib): Fix version support table 2022-09-13 15:42:41 -05:00
Ed Page
7ee121a2e0
Merge pull request #4213 from epage/reset
feat: Allow resetting builder methods
2022-09-13 15:27:59 -05:00
Ed Page
23ce67e323 feat: Allow resetting builder methods
Fixes #4178
2022-09-13 15:16:57 -05:00
Ed Page
f68500d9fd fix: Replace Arg::env with Arg::env_os
With `Into<OsStr>`, the separate function isn't needed.
2022-09-13 14:55:12 -05:00
Ed Page
ee387c66f9
Merge pull request #4212 from epage/width
docs: Clarify role of max_term_width
2022-09-13 13:53:19 -05:00
Ed Page
da9691d369 docs: Clarify role of max_term_width 2022-09-13 11:40:06 -05:00
Ed Page
d2503a4a88
Merge pull request #4209 from epage/prep
feat(derive): Reserve behavior needed for implicit ArgGroups
2022-09-13 08:50:05 -05:00
Ed Page
d3bf5450ff feat(derive): Reserve the T group name
Since the `name` is changed to be the package name, we can't use it as
(1) its not as predictable and (2) it can lead to conflicts if a
`Parser` is flattened into a `Parser`
2022-09-13 07:44:36 -05:00
Ed Page
01c0975678 feat(derive): Reserve 'group_id' trait method 2022-09-13 07:06:12 -05:00
Ed Page
3bfa9d5ff0 feat(derive): Reserve 'group' attribute 2022-09-13 07:06:06 -05:00
Ed Page
79321f25e4
Merge pull request #4208 from epage/columns
fix(help): Respect LINES and COLUMNS
2022-09-12 21:18:00 -05:00
Ed Page
0eb95022a5 fix(help): Respect LINES and COLUMNS
Fixes #4186
2022-09-12 20:17:20 -05:00
Ed Page
0760498200 refactor(help): Allow looking up dimensions independently 2022-09-12 19:55:13 -05:00
Ed Page
1466cd5f55
Merge pull request #4207 from epage/arg
fix: Make `arg!(--flag <value>)` optional by default
2022-09-12 19:47:59 -05:00
Ed Page
c9eef44213 fix: Make arg!(--flag <value>) optional by default
This was ported over from the usage parser which modeled after docopt.
We just never got around to implementing the rest of the syntax.

However, when considering this as a standalone feature, an
`arg!(--flag <value>)`, outside of other context, should be optional.
This is how the help would display it.

Fixes #4206
2022-09-12 17:10:01 -05:00
Ed Page
75a73f3fe0 docs: Feature moved to v3 2022-09-12 16:25:18 -05:00
Ed Page
a86e55ad3e docs: Add more highlights 2022-09-09 19:06:33 -05:00
Ed Page
fadcaf9860 docs: Help people through Action changes 2022-09-08 16:02:12 -05:00
Ed Page
6f185a8704 docs: Clarify intent of upgrade link 2022-09-08 15:56:56 -05:00
Ed Page
bf98110adc
Merge pull request #4197 from epage/dynamic
fix: Tests/clippy/errors bash dynamic completion
2022-09-07 20:25:20 -05:00
Roland Fredenhagen
a2cf7f1dea fix: Tests/clippy/errors bash dynamic completion 2022-09-07 20:25:06 -05:00
Ed Page
4e703d1e2e
Merge pull request #4193 from epage/stable
revert(derive): Bald action/value_parser are deprecated, its good enough
2022-09-07 20:01:00 -05:00
Ed Page
430a384984
Merge pull request #4196 from epage/link
docs(parser): Clarify needs for negative numbers
2022-09-07 20:00:49 -05:00
Ed Page
81c3925bb8
Merge pull request #4194 from epage/assert
perf(assert): Don't make release pay the cost
2022-09-07 20:00:35 -05:00
Ed Page
fa7a1fca58 docs(parser): Clarify needs for negative numbers 2022-09-07 19:48:10 -05:00
Ed Page
afeed4043c perf(assert): Don't make release pay the cost 2022-09-07 19:43:26 -05:00
Ed Page
17f49df4e2 revert(derive): Bald action/value_parser are deprecated, its good enough
When I removed these in v5, we didn't have a deprecation approach for
the derive and I didn't want to forget.  Now we do have a deprecation
approach and that is the reminder, so we don't need to carry around v5
changes.
2022-09-07 19:34:50 -05:00
Ed Page
b502ac750b docs: Summarize reason for change 2022-09-07 19:30:57 -05:00
Ed Page
a9333b7074 docs: Specify that we will support prior major versions
This came up in a [reddit
discussion](https://www.reddit.com/r/rust/comments/vbep9q/clap_32_last_call_before_40/ic91vul/)
and seems like a way we can reduce concerns over clap churn without an
undue burden on maintainers.
2022-09-07 19:12:01 -05:00
Ed Page
985a1b9b4a docs(derive): Collect tips at end 2022-09-07 18:56:05 -05:00
Ed Page
c95c9f2fac
Merge pull request #4192 from epage/tab
fix(help): Make output more dense
2022-09-07 18:52:29 -05:00
Ed Page
c90a4eabae fix(help): Make output more dense
In looking at other help output, I noticed that they use two spaces, in
place of clap's 4, and it doesn't suffer from legibility.  If it
doesn't make the output worse, let's go ahead and make it as dense so we
fit more content on the screen.

This is a part of #4132
2022-09-07 17:13:55 -05:00
Ed Page
ed6475e9de fix(help): Clarify what is tab dependent and what isn't 2022-09-07 16:39:14 -05:00
Ed Page
56fe50eab8 fix(help): I think this fixes a bug?
The existing behavior is hard to explain, so this is the best I've
figured is going on.
2022-09-07 16:38:33 -05:00
Ed Page
876da97d1c fix(help): Make next-line help less sensitive to tab changes 2022-09-07 15:52:26 -05:00
Ed Page
d3fc37b678 fix(help): Long-only indentation is independent of TAB 2022-09-07 15:07:47 -05:00
Ed Page
65c289784b
Merge pull request #4190 from epage/nxt
fix(help):Be dense on short next line help
2022-09-07 14:28:06 -05:00
Ed Page
bbb6c38bad fix(help):Be dense on short next line help
If short help is too long for the terminal, clap will automatically
switch to next line help.  As part of next line help for longs, we add a
blank line between args.  This helps make the args clearer when dealing
with multiple paragraphs.  However, its not as much needed for short and
subcommands (always short), so now short matches subcommands.

This was inspired by #3300 and a part of #4132
2022-09-07 14:05:17 -05:00
Ed Page
69dd145767 docs: Fix code fence 2022-09-07 13:40:03 -05:00
Ed Page
b7b12ea558 docs: Add another highlighted difference 2022-09-07 12:45:25 -05:00
Ed Page
55e2297174 docs: Write v4 migration 2022-09-07 12:43:57 -05:00
Ed Page
4cb42c640d
Merge pull request #4189 from epage/last
docs: Show how last can be used
2022-09-07 11:44:28 -05:00
Ed Page
61f8a9375a docs: Show how last can be used
We can't quite get git's behavior because it has `last` as both before
and after `--`
2022-09-07 11:27:39 -05:00
Ed Page
a228df39b8
Merge pull request #4188 from epage/usage
fix(help): Collapse usage to one line
2022-09-07 11:19:42 -05:00
Ed Page
9a645d2d19 fix(help): Collapse usage to one line
After looking at more examples, I've become more attached to this
briefer format.

Part of #4132
2022-09-07 11:03:57 -05:00
Ed Page
f97670aca8
Merge pull request #4187 from epage/exp
fix(parser): Resolve problems around `allow_hyphen_values`
2022-09-07 07:39:23 -05:00
Ed Page
1258f3e5f6 fix: Deprecate Command::allow_negative_numbers
Better to set on individual args
2022-09-07 07:24:42 -05:00
Ed Page
8ad29ef337 feat: Allow specifying negative nums on Arg, like hyphens 2022-09-07 07:18:19 -05:00
Ed Page
16d5a2a19a perf: Shrink the code 2022-09-07 07:00:58 -05:00
Ed Page
2ebe5ae795 docs: Cross-link allow_hyphe_values with trailing_var_arg 2022-09-06 21:24:06 -05:00