#shell-completion #completion #clap #bash #fish #cli

clap_autocomplete

Easy to integrate shell completion for Clap. Finds the user's shell and puts completion files in the appropriate locations.

7 unstable releases (3 breaking)

0.4.1 Feb 10, 2023
0.4.0 Oct 17, 2022
0.3.0 Oct 5, 2022
0.2.1 Apr 20, 2022
0.1.1 Mar 13, 2022

#510 in Command-line interface

Download history 31/week @ 2023-12-04 8/week @ 2023-12-11 12/week @ 2023-12-18 24/week @ 2023-12-25 104/week @ 2024-01-01 25/week @ 2024-01-08 24/week @ 2024-01-15 41/week @ 2024-01-22 42/week @ 2024-01-29 43/week @ 2024-02-05 8/week @ 2024-02-12 89/week @ 2024-02-19 45/week @ 2024-02-26 32/week @ 2024-03-04 66/week @ 2024-03-11 48/week @ 2024-03-18

197 downloads per month
Used in 3 crates

MIT/Apache

10KB
114 lines

Easy to integrate shell completion for Clap. Finds the user's shell and puts completion files in the appropriate locations.

A library which adds a subcommand to your command. It also checks the matches and returns whether or not the operation succeeded.

Supported shells

This supports the same shells as clap_complete.

It however only supports placing the completion files for Fish, Bash, and Zsh. If the user is using any other shell, they will have to pipe the output into a file.

Documentation

Documentation for releases can be found on docs.rs. Main branch documentation is found on doc.icelk.dev.

Versions

  • 0.1.x: Clap >= 3.1, < 4
  • 0.2.x: Clap >= 3.1, < 4
  • 0.3.x: Clap 4
  • 0.4.x: Clap 4

Changelog

0.4.1

  • Update query-shell dependency.

0.4.0

  • Fix compilation on Windows by disabling automatic writing to shell completions.

0.3.0

  • Update to Clap 4

0.2.1

  • Faster fetching of shell
  • 4 nested dependencies removed

0.2.0

  • Much faster fetching of shell.
  • 20 less dependencies (removed rayon, which was included as part of sysinfo in the old shell fetch crate).
  • Better output of OS errors.
  • Status messages print to stderr.
  • Removed dependency on clap's default features (e.g. regex).

License

Dual-licensed under Apache 2.0 or MIT.

Dependencies

~2–2.9MB
~56K SLoC