summaryrefslogtreecommitdiffstats
path: root/tool/build.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-03-26 12:15:15 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-03-26 15:15:24 +0200
commit1ff26b2ded7052d87617ea6f38b727e34e646ee9 (patch)
tree40daae65452c9ecb761f6479355cc5b1b847960c /tool/build.rs
parenta1b1ccd7d85f453e16cc11b38884759df306d4fa (diff)
tool: Create completion scripts for bash and fish.
Diffstat (limited to 'tool/build.rs')
-rw-r--r--tool/build.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tool/build.rs b/tool/build.rs
new file mode 100644
index 00000000..7517a2fb
--- /dev/null
+++ b/tool/build.rs
@@ -0,0 +1,17 @@
+extern crate clap;
+
+use std::env;
+use clap::Shell;
+
+include!("src/cli.rs");
+
+fn main() {
+ let outdir = match env::var_os("OUT_DIR") {
+ None => return,
+ Some(outdir) => outdir,
+ };
+ let mut app = build();
+ for shell in &[Shell::Bash, Shell::Fish] {
+ app.gen_completions("sq", *shell, &outdir);
+ }
+}