aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-04-25 15:53:17 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-25 15:53:17 +0200
commit49429688cf08081fd5e1dcd1a1769f0f969c9d3a (patch)
tree809c8da46a25c87b36fe8d20ffba40b62f36eff5 /src
parentAdd subcommand to generate completions (diff)
downloadsl0ppij-49429688cf08081fd5e1dcd1a1769f0f969c9d3a.tar.gz
sl0ppij-49429688cf08081fd5e1dcd1a1769f0f969c9d3a.tar.xz
sl0ppij-49429688cf08081fd5e1dcd1a1769f0f969c9d3a.zip
fixup! Add subcommand to generate completions
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs5
-rw-r--r--src/main.rs12
2 files changed, 7 insertions, 10 deletions
diff --git a/src/cli.rs b/src/cli.rs
index b6b0ec3c..ba6911d9 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -53,8 +53,5 @@ pub enum ConfigCli {
},
#[structopt(name = "generate-completion")]
- GenerateCompletion {
- shell: String,
- },
+ GenerateCompletion { shell: String },
}
-
diff --git a/src/main.rs b/src/main.rs
index 377ef4f6..8da85c87 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -47,15 +47,15 @@ pub fn main() {
stream.write_all(&api_command).unwrap();
} else if let Some(crate::cli::ConfigCli::GenerateCompletion { shell }) = opts.option {
let shell = match shell.as_ref() {
- "bash" => structopt::clap::Shell::Bash,
- "fish" => structopt::clap::Shell::Fish,
- "zsh" => structopt::clap::Shell::Zsh,
+ "bash" => structopt::clap::Shell::Bash,
+ "fish" => structopt::clap::Shell::Fish,
+ "zsh" => structopt::clap::Shell::Zsh,
"powerShell" => structopt::clap::Shell::PowerShell,
- "elvish" => structopt::clap::Shell::Elvish,
- other => {
+ "elvish" => structopt::clap::Shell::Elvish,
+ other => {
eprintln!("Unsupported shell: {}", other);
std::process::exit(1);
- },
+ }
};
let mut out = std::io::stdout();
CliArgs::clap().gen_completions_to("zellij", shell, &mut out);