Commit graph

267 commits

Author SHA1 Message Date
Ed Page
d222ae4cb6 chore: Release 2024-08-08 11:09:07 -05:00
Gibson Fahnestock
6f215eee98
refactor(styles): make styles example use a const
This makes it easier to copy this example for use in the derive API,
like so:

```rust
const STYLES: Styles = Styles::styled()
    .header(AnsiColor::Green.on_default().bold())
    .usage(AnsiColor::Green.on_default().bold())
    .literal(AnsiColor::Blue.on_default().bold())
    .placeholder(AnsiColor::Cyan.on_default());

#[derive(Parser)]
#[clap(styles = STYLES)]
struct Cmd {
  ...
}
```

If you use the `|` method then it's not a constant function.
2024-08-08 15:04:32 +01:00
Ed Page
0c4c586083 docs(builder): Remove bad copy/paste docs
Fixes #5626
2024-08-07 15:26:05 -05:00
Ed Page
11538586eb fix(ext)!: Make extension methods fluent 2024-08-07 10:40:07 -05:00
Ed Page
862a0ffe9b docs: Include unstable-ext 2024-08-07 10:29:42 -05:00
Ed Page
ddd3b0c6b7 refactor(builder): Move ValueHint to an ArgExt 2024-08-02 09:59:46 -05:00
Ed Page
19f935aa61 feat(builder): Add Extension API 2024-08-02 09:46:44 -05:00
Ed Page
280d921dee refactor(buider): Simplify Extension's design 2024-08-02 08:49:48 -05:00
Ed Page
4edfd7220a docs: Mark unstable-styles feature as deprecated 2024-08-02 08:22:31 -05:00
Ed Page
99f1fa6b51 docs: Cross-link color control to Command::styles
Inspired by #5590
2024-08-01 09:52:50 -05:00
Ed Page
66b5a122ec chore: Release 2024-07-31 16:26:41 -05:00
Ed Page
360bb3bc11 fix(help): Properly wrap subcommand about
Fixes #5607
2024-07-31 16:17:40 -05:00
Ed Page
d18615dfc0 chore: Release 2024-07-31 12:20:00 -05:00
Ed Page
82912c3a51 style: Make clippy happy 2024-07-26 14:24:08 -05:00
Ed Page
78daebd4ec chore: Upgrade backtrace 2024-07-26 09:36:43 -05:00
Ed Page
4a00677024 chore: Release 2024-07-25 08:39:13 -05:00
Ed Page
8697a6134b chore: Release 2024-07-23 10:32:00 -05:00
Ed Page
73b07c9ab5 docs: Remove stale ColorChoice platform notes
This was called out in #5590
2024-07-20 12:14:22 -05:00
shannmu
d68c91af95 feat(clap_complete): Support hiding subcommands and their aliases 2024-07-19 11:20:16 -05:00
shannmu
d1e0f6073c feat(clap_complete): Support hiding long flags and their long aliases 2024-07-19 22:49:35 +08:00
Ed Page
43e7368283 chore: Release 2024-07-08 21:07:21 -05:00
Zanie Blue
2eb842cc3b feat: Show user defined help flags in hints
This allows display of user-defined help flags during "try 'help'" style
messages
2024-07-08 19:01:22 -05:00
Ed Page
469d847d35 chore: Release 2024-06-28 12:44:19 -04:00
Ed Page
cf151fd46b
Merge pull request #5542 from casey/exit-without-flushing
Exit without flushing stdout and stderr
2024-06-21 12:45:51 -05:00
Casey Rodarmor
90b2661ad0 fix: Exit without flushing stdout and stderr
Standard out is flushed during `std::rt::cleanup()`, called by
`std::process::exit()`, and standard error is unbuffered, so doesn't
need to be flushed.
2024-06-19 21:19:32 -07:00
rustco
462c5ada4a chore: fix some comments
Signed-off-by: rustco <ruster@111.com>
2024-06-20 11:40:13 +08:00
Ed Page
b3effeae10 style: Make clippy happy 2024-06-13 12:45:33 -05:00
Ed Page
6c6839a454 chore: Release 2024-06-10 09:30:20 -05:00
Ed Page
cf5c95862e fix(parser): Report correct num_args on too-few
Fixes #5526
2024-06-10 09:16:53 -05:00
Ed Page
122a2b3b8a chore: Release 2024-06-06 16:36:35 -05:00
Ed Page
d87dee6d48
Merge pull request #5476 from pzmarzly/issue-4265
feat(complete): generate completions for visible aliases
2024-06-06 16:33:01 -05:00
Ed Page
f087c39884 chore: Release 2024-06-06 15:14:24 -05:00
Ed Page
08656d046e fix(parser): Allow exclusive to override required_*
There are other cases for `required` that aren't being handled
- Groups
- Conflicts

I'm concerned there might be weird corner cases and didn't want the
analysis for that to block fixing this.

Fixes #5507
2024-06-06 15:01:04 -05:00
Ed Page
5e3386bb40 docs: Link to repo, not webpage inside repo 2024-06-04 15:36:17 -05:00
Ed Page
4aefa3c1c7 docs(ref): Clean up long help descriptions 2024-05-20 16:09:03 -05:00
Ed Page
d408a823a6
Merge pull request #5491 from pgerber/doc
Fix documentation for Command::after_long_help()
2024-05-20 16:05:08 -05:00
Peter Gerber
659e936a02
docs: Fix documentation for Command::*long_*()
long_help() does not propagate the message to help(). Nor do the
others.
2024-05-20 20:47:01 +00:00
Pawel Zmarzly
5000d58f38 feat(complete): Add autocomplete for visible_alias
Let's generate autocompletions for aliased subcommands.

    $ source before.zsh
    $ clap-test [TAB] <- gives me "foo bar --"
    $ clap-test foo [TAB] <- gives me "--my-flag"
    $ clap-test bar [TAB] <- no reaction

    $ source after.zsh
    $ clap-test [TAB] <- gives me "foo bar --"
    $ clap-test foo [TAB] <- gives me "--my-flag"
    $ clap-test bar [TAB] <- gives me "--my-flag"
2024-05-17 15:17:44 +01:00
Ed Page
958c749e61 style: Make clippy happy 2024-05-14 14:06:10 -05:00
Ed Page
22148eb87d fix(help): Take long_help into account for next_line_help detection 2024-05-14 13:53:17 -05:00
Ed Page
800d7cb8ad chore: Update from template 2024-05-14 12:27:02 -05:00
Ed Page
7d3a380b3d docs(ref): Clean up default_missing_value grammar 2024-05-03 10:59:45 -05:00
Ed Page
11ff6ccb0d docs(ref): Clarify Count starts from 0 2024-05-03 10:59:45 -05:00
renovate[bot]
24651fcfef
chore(deps): update compatible (dev) (#5477)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-01 01:04:57 +00:00
Will-Low
41c0d514bc Update doctring for BoolishValueParser::new 2024-04-23 12:14:42 -07:00
Ed Page
93d40450f7 docs: Fix typo 2024-04-09 12:05:12 -05:00
Ed Page
f65d421607 chore: Release 2024-03-06 10:52:18 -06:00
Amaan Qureshi
2aea9504c4
fix: Use SCREAMING_SNAKE_CASE for static variable authors 2024-03-05 23:52:48 -05:00
Ben Wiederhake
0076cac7cb fix(builder): Don't doc-link to undocumented item 2024-02-23 01:40:29 +01:00
Ed Page
8a7a13a561 chore: Release 2024-02-16 07:08:54 -06:00