clap/clap_complete/examples/bash_completion.rs

12 lines
292 B
Bash
Raw Normal View History

2020-02-06 10:19:03 +00:00
use clap::App;
2021-12-31 19:20:55 +00:00
use clap_complete::{generate, shells::Bash};
2020-02-06 10:19:03 +00:00
use std::io;
fn main() {
let mut app = App::new("myapp")
.subcommand(App::new("test").subcommand(App::new("config")))
.subcommand(App::new("hello"));
generate(Bash, &mut app, "myapp", &mut io::stdout());
2020-02-06 10:19:03 +00:00
}