Skip to content

Commit

Permalink
feat(cli): Add Elvish & Powershell completion output (not installed)
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed May 4, 2020
1 parent 50bb0c8 commit 22c888c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 9 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
extern crate vergen;

use clap::{IntoApp};
use clap_generate::{generate_to, generators};
use clap::IntoApp;
use clap_generate::generate_to;
use clap_generate::generators::{Bash, Elvish, Fish, PowerShell, Zsh};
use std::env;
use vergen::{generate_cargo_keys, ConstantsFlags};

Expand All @@ -20,7 +21,10 @@ fn main() {
Some(outdir) => outdir,
};
let mut app = Cli::into_app();
generate_to::<generators::Bash, _, _>(&mut app, "casile", &outdir,);
generate_to::<generators::Fish, _, _>(&mut app, "casile", &outdir,);
generate_to::<generators::Zsh, _, _>(&mut app, "casile", &outdir,);
let bin_name = "casile";
generate_to::<Bash, _, _>(&mut app, bin_name, &outdir);
generate_to::<Elvish, _, _>(&mut app, bin_name, &outdir);
generate_to::<Fish, _, _>(&mut app, bin_name, &outdir);
generate_to::<PowerShell, _, _>(&mut app, bin_name, &outdir);
generate_to::<Zsh, _, _>(&mut app, bin_name, &outdir);
}
4 changes: 0 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ pub enum Subcommand {
/// Path to project repository
#[clap(default_value = "./")]
path: path::PathBuf,

// /// Output Bash, Fish, Zsh, PowerShell, or Elvish shell completion rules
// #[clap(long)]
// completions: clap::Shell,
},

/// Pass through other commands to shell
Expand Down

0 comments on commit 22c888c

Please sign in to comment.