Commit graph

106 commits

Author SHA1 Message Date
Ed Page
e78bba0ec5 chore: Release 2023-03-16 10:42:06 -05:00
Ed Page
6c0600a031 chore: Fully specify dependencies 2023-03-16 06:07:08 -05:00
Ed Page
ec878c849b chore: Release 2023-02-22 16:15:24 -06:00
Ed Page
f3be52ed7d docs: Update changelog 2023-02-22 16:15:12 -06:00
Ed Page
776f12ebb6
Merge pull request #4645 from bgilbert/mangen-flag
fix(mangen): Avoid spurious value names for derive args without values
2023-02-22 16:14:21 -06:00
Ed Page
fb9435d026 chore: Release 2023-02-15 10:27:15 -06:00
Martin
704d0e7a4f chore: Make format!() calls more readable 2023-01-29 19:14:47 +00:00
Ed Page
2c64f920e2 docs(man): Remove version from setup steps 2023-01-27 11:38:33 -06:00
Benjamin Gilbert
3755c56dcf fix(mangen): Avoid spurious value for derive arg
derive arguments like this:

    #[arg(long)]
    pub flag: bool,

were producing option descriptions like this:

    --flag=FLAG

FLAG is spurious.  It turns out that derive always sets a value name, for
simplicity, even when there are no arguments.  Check for this case.

Fixes #4443.
2023-01-16 12:04:43 -05:00
Ed Page
34d856b449 chore: Release 2023-01-13 09:27:31 -06:00
Ed Page
889ca7a537 chore: Bump versions for 4.1 2023-01-13 09:24:37 -06:00
Ed Page
a41ca2edb0 docs: Update changelog 2023-01-13 07:13:28 -06:00
Enrico Guiraud
84314614fb
docs: prefer ok_or to ok_or_else in README example
As suggested by clippy when using the example code.
2023-01-11 16:41:08 -06:00
Ed Page
fa02111092 chore: Switch to workspace inheritance 2023-01-09 12:35:54 -06:00
Ed Page
f25fe5b3e0 chore: Bump MSRV to 1.64.0 2023-01-09 12:29:41 -06:00
Ed Page
36bc641648 fix(help): Remove extraneous text from built-ins
This is an intermediate solution for #4408.  As there were no agreeed
upon goals, I went with what I felt read well and that I saw commonly
used on non-clap commands.

- "information" isn't really a necessary word.
- I originally favored `Print this help` but realied that doesn't read
  correctly in completions.
- Besides being shorter, the reason for the flipped short/long hint is
  it gives people the context they need for scanning, emphasizing
  "summary" and "more".

Fixes #4409
2023-01-03 11:02:26 -06:00
Ed Page
0eccd556ac chore: Release 2022-12-22 12:40:15 -06:00
Ed Page
dde22e74ca style: Update for latest clippy 2022-12-22 12:25:33 -06:00
Ed Page
3262016c26 chore: Release 2022-11-24 11:40:15 -06:00
Ed Page
623ccbc152 style: Make clippy happy 2022-11-24 08:05:21 -06:00
Ed Page
27bfcc56a9 chore: Release 2022-10-31 06:54:01 -05:00
Ed Page
c8423ff42d docs(man): Update changelog 2022-10-31 06:52:32 -05:00
Daniel Rivas
7030e9e995 fix: Don't show default values for flags
Also show ellipsis for repeatable arguments.
2022-10-30 18:28:17 +00:00
Ed Page
996636d56f chore: Release 2022-10-18 14:37:53 -05:00
Ed Page
3e23cd102f fix: Require release versions of clap 2022-10-18 14:36:44 -05:00
dependabot[bot]
f0d971562a
chore(deps): bump snapbox from 0.3.3 to 0.4.0
Bumps [snapbox](https://github.com/assert-rs/trycmd) from 0.3.3 to 0.4.0.
- [Release notes](https://github.com/assert-rs/trycmd/releases)
- [Changelog](https://github.com/assert-rs/trycmd/blob/main/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/trycmd/compare/snapbox-v0.3.3...snapbox-v0.4.0)

---
updated-dependencies:
- dependency-name: snapbox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 18:58:27 +00:00
Ed Page
668c021419 chore: Release 2022-09-29 13:09:30 -05:00
Ed Page
9069755919 docs: Update changelog 2022-09-29 13:09:14 -05:00
Ed Page
d24e723bb4
Merge pull request #4255 from anshulrgoyal/master
[clap_mangen]fix: use proper sub-command name in manpages
2022-09-29 13:07:18 -05:00
Anshul Goyal
cdcf9aad34 fix: Add test for subcommand 2022-09-29 23:07:28 +05:30
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
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
tahmid-23
e6cd076438 fix(mangen): Respect more hide values 2022-09-27 15:40:56 -04: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
16c46b4b3b chore: Release 2022-09-20 16:32:10 -05:00
Ed Page
7a5dad89ff feat(help): Break out help feature flag
This removes auto-generated help, saving about 50 KiB.
2022-09-19 11:54:10 -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
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
6bd4fee69f chore: Update dependencies 2022-09-01 07:09:32 -05:00
Ed Page
c1c269b427 fix(help): Clarify short vs long help
In reviewing CLIs for #4132, I found some were providing helps on `-h`
vs `--help` and figured that could be built directly into clap.  I had
considered not making this hint automatic but I figured the overhead of
checking if long exists wouldn't be too bad.  The code exists (no binary
size increase) and just a simple iteration is probably not too slow
compared to everything else.

Fixes #1015
2022-08-31 14:25:46 -05:00
Ed Page
c6155f62d5 feat: Open the door for user styling in the future
This added about 10 KiB to the `.text` which I cannot explain why
2022-08-24 18:17:42 -05:00
Tyler Calder
a55db43758 fix: Add possible vals to man for positional args
Noticed that possible values would not show up for Positional arguments
as well. Decided to add the changes for those as well.
2022-08-23 22:03:37 -06:00
Tyler Calder
069098cfcb fix: Use roff bullet lists for possible_values 2022-08-23 21:54:46 -06:00
Tyler Calder
ec518e4819 fix: Take in account possible values being hidden
This makes sure we take into account the setting that possible args
is hidden
2022-08-23 21:47:17 -06:00
Tyler Calder
6342802f55 fix: Show possible values in generated man file
This adds feature parity for mangen with the standard help output. Users
will now see the list of possible values for value arguments.

One change that was made to make this possible was adding the method
`get_possible_values` to the public API for an arg. I tried to think of
a way to get around this, but because this is the interface that the
help generation uses, and it is part of the crate public interface
I thing adding it as a part of the public API might be for the best.

fixes: #3861
2022-08-23 21:47:17 -06:00
Ed Page
1bbf07e574 fix: Prefer more usable &str for reflection
The downside is we can't skip allocations with
- `ValueEnum` default values
- Vaid subcommands

Otherwise, this is a big ergonomic win.
2022-08-22 14:56:16 -05:00
Ed Page
85f541d789 fix: Switch to owned types
Impact:
- Binary size: 556.6 KiB to 578.4 KiB
- build time: 6.4950 us (7% slower)
- parse time: 7.7256 us
- parse sc time: 8.1580 us (5% faster)

Fixes #1041
Fixes #2150
2022-08-22 14:55:55 -05:00