Commit graph

7443 commits

Author SHA1 Message Date
Ed Page
929c87c5b8
Merge pull request #4281 from epage/override
fix(parser): Allow one-off self-overrides
2022-09-28 17:00:55 -05:00
Ed Page
3683e2c791 fix(parser): Allow one-off self-overrides
bat needed this.

See also #4261
2022-09-28 16:45:35 -05:00
Ed Page
2d7874948f fix(parser): SetFalse should also not allow self-override 2022-09-28 16:26:36 -05:00
Ed Page
bf42ff04d5 chore: Release 2022-09-28 15:34:33 -05:00
Ed Page
824f6589ad docs: Update changelog 2022-09-28 15:34:25 -05:00
Ed Page
7b886d2c63
Merge pull request #4278 from intgr/zsh-completion-fix-multiple-args-handling
fix(complete): Fix zsh handling of multiple arguments
2022-09-28 15:33:42 -05:00
Marti Raudsepp
89cae3a2b3 fix(complete): Fix handling of multiple arguments 2022-09-28 23:02:31 +03:00
Ed Page
f6602c573c chore: Release 2022-09-28 14:51:22 -05:00
Ed Page
1e171cfef6 docs: Update changelog 2022-09-28 14:47:24 -05:00
Ed Page
f1dffa1446
Merge pull request #4277 from epage/help
docs(complete): Ensure examples work
2022-09-28 14:45:35 -05:00
Ed Page
31e58cc45b
Merge pull request #4276 from epage/derive
fix(derive): Ensure clap/structopt attributes still work
2022-09-28 14:45:26 -05:00
Ed Page
cad5cde3e9
Merge pull request #4275 from wolthom/patch-1
Fix inline code snippet typos
2022-09-28 14:36:31 -05:00
Ed Page
8aafddff01 docs(complete): Ensure examples work
Fixes #4272
2022-09-28 14:34:56 -05:00
Ed Page
24be631f86 fix(derive): Ensure clap/structopt attributes still work
The problem with updating all code to use non-deprecated APIs, there
aren't tests for the old way anymore.

Fixes #4274
2022-09-28 14:29:39 -05:00
Ed Page
79ba02daa5 fix(derive): Quote the attribute in the error 2022-09-28 14:27:08 -05:00
Wolf Thomsen
0f45ac7235
Fix inline code snippet typos
There are a couple of typos where a backtick is missing / too much which results in slightly broken formatting. This PR should hopefully fix them.
2022-09-28 21:26:56 +02:00
Ed Page
5d9920480c Merge branch 'master' into HEAD 2022-09-28 12:03:37 -05:00
Ed Page
3a74d82376 chore: Release 2022-09-28 12:00:48 -05:00
Ed Page
eed6aec503
Merge pull request #4271 from tahmid-23/mangen-hide-fix
fix(mangen): Respect more hide values
2022-09-27 15:47:39 -05:00
tahmid-23
e6cd076438 fix(mangen): Respect more hide values 2022-09-27 15:40:56 -04:00
Ed Page
9cd1939535
Merge pull request #4269 from epage/usage
fix(error): Polish `--flag=bad-value` error
2022-09-27 09:42:11 -05:00
Ed Page
cb1cd67009 fix(error): Include failed arg in usage in --flag=bad-value error 2022-09-27 09:25:24 -05:00
Ed Page
12d76d649a fix(error): Include 'Usage:' title in --flag=bad-value error 2022-09-27 09:20:42 -05:00
Ed Page
3a8d2a579b test(parser): Verify existing --flag=bad-value case 2022-09-27 09:19:27 -05:00
Ed Page
c7dd03e7ea
Merge pull request #4267 from jpgrayson/override-usage-help-4
docs: Update multiline usage override rules
2022-09-27 09:05:43 -05:00
Ed Page
f925ca84b6 docs: Clarify how to use examples
When we restuctured the examples, we lost the notes on how they should
be structured, so this adds it back in.
2022-09-26 21:06:02 -05:00
Peter Grayson
7dd216b1e6
docs: Update multiline usage override rules
The styling of usage has changed in #4188 such that the usage string is on
the same line as the "Usage:" title. Previously, the usage went on the line
below the title. As such, the rules have changed for how to make a
multiline usage format correctly.

These updated rules achieve the following output for the documented
example:

    Usage: myapp -X [-a] [-b] <file>
           myapp -Y [-c] <file1> <file2>
           myapp -Z [-d|-e]

Relates-to: #4132
2022-09-26 21:57:09 -04:00
Ed Page
a0c8c7dbd5 docs: Clean up StyledStr entries 2022-09-26 13:51:56 -05:00
Ed Page
01672f8359 chore: Release 2022-09-26 13:42:34 -05:00
Ed Page
a5ce7a0187
Merge pull request #4262 from epage/conflict
fix(parser): Conflict-with-self is back on by default
2022-09-26 13:41:45 -05:00
Ed Page
9bccded7ed fix(parser): Conflict-with-self is back on by default
See #4261 for more details
2022-09-26 13:29:48 -05:00
Ed Page
7998669219
Merge pull request #4259 from epage/try
perf: Drop use of Into::into for '?'
2022-09-26 12:48:39 -05:00
Ed Page
4a1552cc0e perf: Drop use of Into::into for '?'
For binary size, this only dropped 0.2 KiB

For performance, before:
- parse_rustup_with_sc    time:   [7.9866 µs 8.0138 µs 8.0470 µs]
After:
- parse_rustup_with_sc    time:   [7.5387 µs 7.5722 µs 7.6157 µs]

For build-time, before
```console
$ hyperfine --warmup=1 --min-runs=5 "--prepare=cargo clean" "cargo build -F cargo --example cargo-example"
Benchmark 1: cargo build -F cargo --example cargo-example
  Time (mean ± σ):     16.988 s ±  1.190 s    [User: 68.178 s, System: 6.637 s]
  Range (min … max):   15.550 s … 18.277 s    5 runs
```
After:
```console
$ hyperfine --warmup=1 --min-runs=5 "--prepare=cargo clean" "cargo build -F cargo --example cargo-example"
Benchmark 1: cargo build -F cargo --example cargo-example
  Time (mean ± σ):     15.674 s ±  0.222 s    [User: 62.287 s, System: 4.608 s]
  Range (min … max):   15.426 s … 15.993 s    5 runs
```
2022-09-26 12:31:39 -05:00
Ed Page
c4b3a4f491 refactor: Remove use of '?' 2022-09-26 12:19:30 -05:00
Ed Page
18ed37ee67
Merge pull request #4258 from epage/features
fix(help)!: Wrapping is behind wrap_help
2022-09-26 12:01:24 -05:00
Ed Page
3c9bca5ead fix(help)!: Wrapping is behind wrap_help
If users don't want `wrap_help` feature, they can put newlines in where
needed.  Seems odd to support wrapping when the wrap size is fixed.  For
those hard coding the lines, this will save them a decent amount of
size.
2022-09-26 11:45:44 -05:00
Ed Page
bac3eb3280 docs: Raise visibility of 'string' feature 2022-09-26 11:14:06 -05:00
Ed Page
2f93c1790f docs: Help migrate with default features 2022-09-26 11:11:55 -05:00
Ed Page
3772bdf041 docs: Update changelog 2022-09-26 11:08:59 -05:00
Ed Page
c5c3c00735
Merge pull request #4257 from epage/os_str
feat(parser): Support more types with `value_parser!`
2022-09-26 10:50:14 -05:00
Ed Page
bd6b67c605 style: Make clippy happy 2022-09-26 09:55:02 -05:00
Ed Page
31f9234cc7 feat(parser): Add From<str> and From<String> 2022-09-26 09:51:44 -05:00
Ed Page
931b6338f1 refactor(parser): Clarify FromStr from future FromStr 2022-09-26 09:51:03 -05:00
Ed Page
76ec238b45 docs: Clarify value_parser implementation 2022-09-26 09:50:51 -05:00
Ed Page
9f49c0c630 feat(parser): Support From<OsString> for value_parser 2022-09-26 09:50:49 -05:00
Ed Page
e64ed91a4e feat(parser): Support From<&OsStr> types for value_parser!
Last time I tried this, I wasn't able to resolve the lifetime issues.  I
seemed to have gotten it working this time.

This came up in #4254.
2022-09-26 09:50:12 -05:00
Anshul Goyal
637e7be3a4 fix: Format with rustfmt 2022-09-24 23:45:50 +05:30
Anshul Goyal
6436d19b68 fix: Use proper sub-command name in manpages 2022-09-24 23:38:44 +05:30
Ed Page
0380d8deca
Merge pull request #4248 from epage/ansi
feat: Allow users to render usage, help, and errors with ANSI
2022-09-22 10:16:39 -05:00
Ed Page
037b07577c feat: Expose ANSI styling to the user
This gives users the control over where clap outputs while still getting
colors.  For users who want to support old windows versions, check out
`fwdansi` crate.
2022-09-22 09:59:42 -05:00