summaryrefslogtreecommitdiffstats
path: root/sq/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sq/build.rs')
-rw-r--r--sq/build.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/sq/build.rs b/sq/build.rs
new file mode 100644
index 00000000..b7d3147d
--- /dev/null
+++ b/sq/build.rs
@@ -0,0 +1,22 @@
+use clap;
+
+use std::env;
+use std::fs;
+use clap::Shell;
+
+mod sq_cli {
+ include!("src/sq_cli.rs");
+}
+
+fn main() {
+ let outdir = match env::var_os("CARGO_TARGET_DIR") {
+ None => return,
+ Some(outdir) => outdir,
+ };
+ fs::create_dir_all(&outdir).unwrap();
+ let mut sq = sq_cli::build();
+ for shell in &[Shell::Bash, Shell::Fish, Shell::Zsh, Shell::PowerShell,
+ Shell::Elvish] {
+ sq.gen_completions("sq", *shell, &outdir);
+ }
+}