Commit graph

124 commits

Author SHA1 Message Date
Ed Page
12b5c39d46 chore: Release 2024-01-11 10:37:53 -06:00
Ed Page
1c5b63390b docs: Update changelog 2024-01-11 10:37:40 -06:00
Ed Page
3eaf1af052 fix(help): Correctly show help for fake flags 2024-01-08 09:58:42 -06:00
renovate[bot]
924b2524d0
chore(deps): update compatible (dev) (#5276)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 01:44:12 +00:00
Ed Page
6d601e6f31 chore: Release 2023-12-28 12:07:48 -06:00
Ed Page
048e7f0fbc docs: Update changelog 2023-12-28 12:07:33 -06:00
Sean Allred
05cd057978
perf: Avoid retrieving possible_values unless used
In some sophisticated situations, these may be expensive to calculate.
One example might be a '--branch' option accepting any single Git
branch that exists on the remote -- in such a case, the remote would
need to be queried for all possible_values. The cost is ultimately
unavoidable at runtime since this validation has to happen eventually,
but there's no need to pay it when generating help text if
`is_hide_possible_values_set`.

To keep '-h' fast, avoid collecting `possible_values` during '-h'
unless we're actually going to use the values in display.

This optimization is repeated for the manpage renderer.

This is trivially based on the short-circuiting logic at [1], which at
least supports the idea that actually consuming the iterator is not
generally-guaranteed behavior when `hide_possible_values` is set.

Note on the 'expensive' mod: This keeps all the possible_values tests
in one file but allows the entire set of tests to be controlled by the
'strings' feature (which is required to be able to use String rather
than str for each possible value).

[1]: clap_builder/src/builder/command.rs:long_help_exists_
2023-12-28 10:06:35 -06:00
renovate[bot]
14fd853fb9
chore(deps): update compatible (dev) (#5192)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-01 01:03:46 +00:00
Ed Page
9bfa5a338c chore: Release 2023-10-24 13:25:07 -05:00
renovate[bot]
4054a0c1a5
chore(deps): update compatible (dev) (#5151)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-01 01:52:25 +00:00
Ed Page
e6e539660f chore: Release 2023-09-18 09:28:47 -06:00
renovate[bot]
dc63cba772
chore(deps): update compatible (dev) (#5108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-01 01:47:45 +00:00
Ed Page
f66484153a chore: Release 2023-08-24 11:10:33 -05:00
Ed Page
7224e5044e docs: Update changelog 2023-08-24 11:06:00 -05:00
Ed Page
50f0e6bffb chore: Release 2023-06-01 21:10:46 -05:00
renovate[bot]
534be345d8
chore(deps): update compatible (dev) 2023-06-01 00:38:25 +00:00
Ed Page
663a35e643 chore: Release 2023-05-19 11:57:00 -05:00
Yuri Astrakhan
a6d50e4219 chore: Remove dup code in mangen 2023-05-03 20:37:51 -04:00
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