Commit graph

224 commits

Author SHA1 Message Date
Ed Page
5fb1b25799
Merge pull request #4883 from nyurik/happy-clippy
chore: Make Clippy happy
2023-05-03 21:13:47 -05:00
Yuri Astrakhan
ebbdce4820 chore: Make Clippy happy 2023-05-03 21:56:07 -04:00
Yuri Astrakhan
797c23c415 chore: Inline format args using clippy fix
This command cleaned up all the format args,
making code significantly shorter and more readable.

```
cargo clippy --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2023-05-03 21:49:11 -04:00
Yuri Astrakhan
47cbc5f247 chore: Deduplicate powershell code complete
Makes powershell code more concise
2023-05-03 21:02:30 -04:00
Ed Page
43591bc1ee chore: Release 2023-04-21 07:42:44 -05:00
Ed Page
9bda2ac8a0 docs: Update changelog 2023-04-21 07:42:33 -05:00
Huan-Cheng Chang
a379bae895 fix: Escape special characters properly for zsh
Signed-off-by: Huan-Cheng Chang <changhc84@gmail.com>
2023-04-20 21:52:36 +02:00
Ed Page
feddd124b0 style: Move away from banned fns 2023-03-30 02:18:00 -05:00
Ed Page
8fc65e28b6 chore: Release 2023-03-28 02:19:08 -05:00
Ed Page
2852653656 chore: Release 2023-03-27 19:41:39 -05:00
Ed Page
2bb4146374 chore: Release 2023-03-25 03:56:28 -05:00
Ed Page
ea4dada1e4 fix(lex): Allow reporting errors for non-UTF8 longs 2023-03-25 03:42:04 -05:00
Ed Page
6419a0d937 perf!(lex): Build faster by removing os_str_bytes
We are doing direct transmutes between `OsStr` and `[u8]`.
https://github.com/rust-lang/rust/pull/95290 would make this natively
supported but I got tired of waitin for it.

This only saves about 1/4s off of `cargo build`.

This took 2.9 KiB off of `cargo bloat --release --example git`
2023-03-25 01:59:24 -05:00
Ed Page
d9a641bcc8 docs: Consistently use console fence type 2023-03-24 21:33:49 -05:00
mochi33i
7c6cf81476 docs(clap_complete): The file name of the command in the clap_complete example documentation was not supported, so it has been updated 2023-03-27 23:24:50 +09:00
Ed Page
e78bba0ec5 chore: Release 2023-03-16 10:42:06 -05:00
Ed Page
dec82598b2 chore: Upgrade trycmd 2023-03-16 06:07:46 -05:00
Ed Page
6c0600a031 chore: Fully specify dependencies 2023-03-16 06:07:08 -05:00
renovate[bot]
8469554c17
chore(deps): update compatible (dev) (#4741)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-01 04:51:19 +00:00
Ed Page
84a9b53cee chore: Release 2023-02-27 04:20:28 -06:00
Ed Page
9fa48d5f92 docs: Update changelog 2023-02-27 04:20:07 -06:00
XiaoXiaoSN
0f3e729358 feat(complete): Support to run ZSH completion as a script 2023-02-27 23:23:50 +08:00
Ed Page
cdb33b6ad2 test(complete): Adjust bash snapshot 2023-02-24 07:40:24 -06:00
Ed Page
2deb372195 chore: Release 2023-02-23 11:56:20 -06:00
Ed Page
c064da01c9 docs: Update changelog 2023-02-23 11:56:12 -06:00
Ed Page
77803337f8
Merge pull request #4612 from davvid/zsh-multi-length-arguments
clap_complete: fix support for two multi-length arguments in zsh
2023-02-23 11:55:17 -06:00
Ed Page
953e2dcd34 docs: Remove remaining references to clap attribute 2023-02-18 18:42:07 -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
90c042eeae chore: Release 2023-01-23 13:05:20 -06:00
Ed Page
4f638b5c75 docs: Update changelog 2023-01-23 13:05:15 -06:00
Fredrik Jansson
3426310d8e fix: Bash test cases 2023-01-23 19:20:09 +01:00
Fredrik Jansson
8b455d28e7 fix: Make cmd a local var in bash completion 2023-01-23 19:07:15 +01: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
David Aguilar
170bd59111 fix(complete): Handle multi-valued arguments
zsh completions for commands that have multiple Vec arguments require
special care.

We can have two Vec args separated with a value terminator.
We can also have two Vec args with no value terminators specified
where the final arg uses 'raw' and thus requires '--' to be used.

The 2nd of these scenarios requires special handling to avoid
emitting a duplicate '*:arguments' completion entry.

Currently, the zsh completions generate an error in this scenario:

    $ my-app <TAB>
    _arguments:...: doubled rest argument definition:
    *::second -- second set of of multi-length arguments:

We already use the '-S' option when calling _arguments.
This option makes it so that completion stops after '--' is encountered.
This means that the handling for trailing 'raw' arguments does not need
to specified.

Special-case multi-valued arguments so that we can skip emitting
the final multi-valued argument if a previous multi-valued argument
has already been emitted.

Closes #3022
Signed-off-by: David Aguilar <davvid@gmail.com>
2023-01-10 14:39:33 -08:00
David Aguilar
58b0c504d8 fix(complete): Emit value terminators on zsh
Emit the user-defined value terminator into the zsh completion pattern
to avoid doubled rest-arguments definitions:

    $ my-app <TAB>
    _arguments:comparguments:325: doubled rest argument definition:
    *::second -- second set of of multi-length arguments:

https://github.com/clap-rs/clap/issues/3266#issuecomment-1007901407
noted that including the value terminator is one step towards a
robust solution for handling multiple multi-valued arguments.

This change does not yet handle automatically detecting when a value
terminator is needed, but it does add tests to ensure that
user-specified value terminators are used on zsh.

Related-to: #3022
Signed-off-by: David Aguilar <davvid@gmail.com>
2023-01-10 00:59:25 -08: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
c2efb60a5f fix(error): Lowercase the start of error messages
This matches the rustc error style
2023-01-03 13:17:46 -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
renovate[bot]
acfc493a35
chore(deps): update compatible (dev) 2023-01-01 02:25:24 +00:00
Ed Page
0eccd556ac chore: Release 2022-12-22 12:40:15 -06:00
renovate[bot]
9b2b718df6
chore(deps): update dev 2022-12-01 21:38:13 +00: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
Hugo Osvaldo Barrera
d169849330 docs: Clarify mention of example elsewhere
This points to "the example above", but there's no example above when
this gets rendered in docs.rs:

    https://docs.rs/clap_complete/latest/clap_complete/generator/fn.generate.html

I suppose this reference is just stale since moving docs from a single
markdown file or something similar.
2022-11-19 12:22:37 +01:00
Ed Page
c75b81eeb8 chore: Release 2022-11-07 07:39:49 -06:00
Ed Page
28324d8df7 docs: Update changelog 2022-11-07 07:39:36 -06:00