-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1967 from jqnatividad/qsv-completions
`contrib(completions)`: add qsv multi-shell completions foundation Awesome, merging it then...
- Loading branch information
Showing
18 changed files
with
922 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "qsv-clap-completions" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
clap = "4.5.9" | ||
clap_complete = "4.5.8" | ||
clap_complete_fig = "4.5.1" | ||
clap_complete_nushell = "4.5.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# qsv completions - bash, zsh, fish, powershell, nushell, fig, elvish | ||
|
||
Generate shell completions for qsv including the following shells: | ||
|
||
- bash | ||
- zsh | ||
- powershell | ||
- fish | ||
- nushell | ||
- fig | ||
- elvish | ||
|
||
There is potential to move this into a `qsv completions` command and/or add it as a feature since clap and several clap-related crates may need to be installed. Also this is currently a manual effort to keep commands up to date. | ||
|
||
> Status: Based on qsv v0.129.0. Not all commands are available. See src/cmd for available commands. | ||
## Usage | ||
|
||
To generate completions for all shells into an examples folder run the `generate_examples.bash` script: | ||
|
||
```bash | ||
bash generate_examples.bash | ||
``` | ||
|
||
To generate a completion manually run: | ||
|
||
```bash | ||
cargo run -- <shell> | ||
``` | ||
|
||
Replace `<shell>` with any of the shells mentioned above. | ||
|
||
The completions output should be printed to your terminal. You may redirect this to a file. For example for Bash completions: | ||
|
||
```bash | ||
cargo run -- bash > completions.bash | ||
``` | ||
|
||
Then run them as your shell intends it to be ran. |
Oops, something went wrong.