diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-03-26 12:15:15 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-03-26 15:15:24 +0200 |
commit | 1ff26b2ded7052d87617ea6f38b727e34e646ee9 (patch) | |
tree | 40daae65452c9ecb761f6479355cc5b1b847960c /tool | |
parent | a1b1ccd7d85f453e16cc11b38884759df306d4fa (diff) |
tool: Create completion scripts for bash and fish.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/Cargo.toml | 4 | ||||
-rw-r--r-- | tool/build.rs | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tool/Cargo.toml b/tool/Cargo.toml index 43864342..a909d812 100644 --- a/tool/Cargo.toml +++ b/tool/Cargo.toml @@ -2,6 +2,7 @@ name = "sequoia-tool" version = "0.1.0" authors = ["Justus Winter <justus@pep-project.org>"] +build = "build.rs" [dependencies] openpgp = { path = "../openpgp" } @@ -13,6 +14,9 @@ failure = "0.1.1" prettytable-rs = "0.6.7" time = "0.1.38" +[build-dependencies] +clap = "2.27.1" + [[bin]] name = "sq" path = "src/usage.rs" 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); + } +} |