From 01f6bddab63d5d1d61baa9e90a326ffe2696762b Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:53:02 -0500 Subject: deps: update clap to 3.x (#690) Updates bottom to use clap 3.x, along with some small refactoring changes. --- build.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'build.rs') 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(); } -- cgit v1.2.3