summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2022-03-07 22:53:02 -0500
committerGitHub <noreply@github.com>2022-03-07 22:53:02 -0500
commit01f6bddab63d5d1d61baa9e90a326ffe2696762b (patch)
treef253911faf60aaca27a6a677cf0e7de1f0b53268 /build.rs
parente682882aeeb09e721f074bc8545770208c3c5321 (diff)
deps: update clap to 3.x (#690)
Updates bottom to use clap 3.x, along with some small refactoring changes.
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/build.rs b/build.rs
index 472a0a6c..479ab963 100644
--- a/build.rs
+++ b/build.rs
@@ -1,5 +1,6 @@
-use clap::Shell;
+use clap_complete::{generate_to, shells::Shell};
use std::{env, fs, process};
+
include!("src/clap.rs");
fn main() {
@@ -24,8 +25,9 @@ fn main() {
// Generate completions
let mut app = build_app();
- app.gen_completions("btm", Shell::Bash, &out_dir);
- app.gen_completions("btm", Shell::Zsh, &out_dir);
- app.gen_completions("btm", Shell::Fish, &out_dir);
- app.gen_completions("btm", Shell::PowerShell, &out_dir);
+ generate_to(Shell::Bash, &mut app, "btm", &out_dir).unwrap();
+ generate_to(Shell::Zsh, &mut app, "btm", &out_dir).unwrap();
+ generate_to(Shell::Fish, &mut app, "btm", &out_dir).unwrap();
+ generate_to(Shell::PowerShell, &mut app, "btm", &out_dir).unwrap();
+ generate_to(Shell::Elvish, &mut app, "btm", &out_dir).unwrap();
}