Commit graph

136 commits

Author SHA1 Message Date
Ed Page
9295e322e8 chore: Release 2024-02-08 10:35:09 -06:00
Ed Page
0735119775 docs: Update changelog 2024-02-08 10:32:13 -06:00
Ed Page
7425ee74e8 chore: Release 2024-02-02 12:43:30 -06:00
Ed Page
2efeb012ec docs: Update changelog 2024-02-02 12:43:23 -06:00
Ed Page
afcd8000e8
Merge pull request #5331 from EdJoPaTo/mangen-files
feat(mangen): generate filename and files
2024-02-02 12:39:06 -06:00
renovate[bot]
4788918e01
chore(deps): update compatible (dev) (#5333)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 01:26:55 +00:00
EdJoPaTo
2b9d991f51
refactor(mangen): Use argument impl over generic 2024-01-30 23:28:27 +01:00
EdJoPaTo
868aa30ef5
feat(mangen): Generate filename and files
The API is inspired by clap_complete.
2024-01-30 22:14:12 +01:00
Ed Page
ba2d1112d1 chore: Release 2024-01-29 14:38:34 -06:00
Ed Page
9d586c8f49 docs: Update changelog 2024-01-29 14:38:19 -06:00
Will Shanks
eaf0b5eea4 fix: Apply PR comments 2024-01-28 16:33:36 -08:00
Will Shanks
29c5690000 fix: Use "full" cmd name in man page
Print the full command, instead of just the last subcommand in the man
page. ex for `git add` print `git-add` instead of simply `add` as the
title and name. For the synopsis print the usage string, so `git add`
2024-01-12 18:47:36 -08:00
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