Skip to content

Commit

Permalink
Merge pull request #106 from Pi-Cla/add-nushell
Browse files Browse the repository at this point in the history
Add nushell completions
  • Loading branch information
tummychow authored Mar 24, 2024
2 parents aca3e56 + 3a19fec commit d259681
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ default-features = false
[dependencies]
clap = { version = "4", features = ["cargo", "wrap_help"] }
clap_complete = "4"
clap_complete_nushell = "4"
slog = "2.5"
slog-term = "2.6"
slog-async = "2.5"
Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ extern crate slog;

use clap::ArgAction;
use clap_complete::{generate, Shell};
use clap_complete_nushell::Nushell;
use slog::Drain;
use std::io;

Expand Down Expand Up @@ -50,7 +51,7 @@ fn main() {
clap::Arg::new("gen-completions")
.help("Generate completions")
.long("gen-completions")
.value_parser(["bash", "fish", "zsh", "powershell", "elvish"]),
.value_parser(["bash", "fish", "nushell", "zsh", "powershell", "elvish"]),
)
.arg(
clap::Arg::new("whole-file")
Expand Down Expand Up @@ -78,6 +79,9 @@ fn main() {
"fish" => {
generate(Shell::Fish, &mut args_clone, app_name, &mut io::stdout());
}
"nushell" => {
generate(Nushell, &mut args_clone, app_name, &mut io::stdout());
}
"zsh" => {
generate(Shell::Zsh, &mut args_clone, app_name, &mut io::stdout());
}
Expand Down

0 comments on commit d259681

Please sign in to comment.