clap/clap_complete_fig/examples/fig_completion.rs

13 lines
323 B
Rust
Raw Normal View History

2022-02-12 03:48:29 +00:00
use clap::Command;
use clap_complete::generate;
use clap_complete_fig::Fig;
use std::io;
fn main() {
2022-02-14 21:47:20 +00:00
let mut cmd = Command::new("myapp")
2022-02-12 03:48:29 +00:00
.subcommand(Command::new("test").subcommand(Command::new("config")))
.subcommand(Command::new("hello"));
2022-02-14 21:47:20 +00:00
generate(Fig, &mut cmd, "myapp", &mut io::stdout());
}