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
Ed Page
d45e4be14b
fix(derive): Deprecate Command::allow_hyphen_values
...
Fixes #3450
2022-09-06 20:50:09 -05:00
Ed Page
7a2bbca62b
fix(derive): Make Command::allow_hyphen_values forward to Arg
2022-09-06 19:41:17 -05:00
Emerson Ford
fd9a5a1d50
fix(parser): Arg::allow_hyphen_values correctly handles long args in first pos
...
This makes it match up with `Command::allow_hyphen_values` which was the
guiding factor for what the behavior should be.
This supersedes #4039
Fixes #3880
Fixes #1538
2022-09-06 19:41:17 -05:00
Ed Page
94a5e7fa1a
refactor(parser): Highlight short/long parallels
2022-09-06 19:41:17 -05:00
Ed Page
bc5c5e4a9f
fix(parser): Make Command/Arg behave same for shorts with allow_hyphen_values
2022-09-06 19:41:17 -05:00
Ed Page
bffce7f57a
fix: Deprecate Command::trailing_var_arg
...
Now that we have it on `Arg`, we don't need it on `Command`
2022-09-06 19:41:17 -05:00
Ed Page
b07d02ef46
feat: Allow specifying trailing_var_arg on Arg, like last
...
This has been a bit out of place being on the command. Now its clearer
what the user intends to be the trailing var arg and it is more likely
to be discovered.
2022-09-06 19:41:14 -05:00
Ed Page
f731ce70e4
Merge pull request #4185 from epage/setting
...
refactor: Use parameters over settings
2022-09-06 15:09:53 -05:00
Ed Page
1dd9245fff
refactor: Use parameters over settings
2022-09-06 14:43:02 -05:00
Ed Page
9a4c2bc990
docs: Improve description around trailing_var_arg
2022-09-06 14:34:47 -05:00
Ed Page
088b396d20
Merge pull request #4184 from epage/doc
...
refactor(derive): Clean up in prep for parent attributes
2022-09-06 13:22:36 -05:00
Ed Page
ede8fd6dbd
style(derive): Clean up to make explicit methods easier
2022-09-06 12:54:50 -05:00
Ed Page
9c85839705
refactor(derive): Simplify processing of Subcommand
2022-09-06 12:54:50 -05:00
Ed Page
51dc3c63d6
refactor(derive): Treat subcommands like other Kinds
2022-09-06 12:54:50 -05:00
Ed Page
222003abe1
fix(derive): Disallow general attributes with from_global
2022-09-06 12:54:50 -05:00
Ed Page
a71b2eb8b8
refactor(derive): Shift responsibility for long help
2022-09-06 12:54:47 -05:00
Ed Page
abcee38466
fix(derive): Improve skip
method error
...
Really this is about consolidating the skip checks but it also provideda
chance to improve the error.
2022-09-06 10:48:54 -05:00
Ed Page
8a5a9ba931
perf(derive): Only parse doc comments when needed for field/variant
2022-09-06 10:43:16 -05:00
Ed Page
9eb72ea5b6
fix(derive): Disallow attributes on top-level ValuEnum
2022-09-06 10:40:12 -05:00
Ed Page
1d973bd1c1
perf(derive): Don't parse ValueEnum's doc comment to ignore it
2022-09-06 10:36:22 -05:00
Ed Page
eece51fe04
refactor(derive): Give more control to the derive
2022-09-06 10:35:19 -05:00
Ed Page
71b9209a34
refactor(derive): Simplify Kind initialization
2022-09-06 07:56:08 -05:00
Ed Page
ade931be57
fix(derive): Be less prescriptive
...
With how flexible clap's API is, it can be hard to determine what is
reasonable to use with its API, so let's just stop.
2022-09-06 07:56:08 -05:00
Ed Page
b29f3ff22f
refactor(derive): Delay error handling
2022-09-06 07:56:08 -05:00