clap/clap_complete_fig/tests/generate_completions.rs

19 lines
512 B
Rust
Raw Normal View History

2022-02-12 03:48:29 +00:00
use clap::{Arg, Command};
use clap_complete::generate;
use clap_complete_fig::Fig;
use std::io;
#[test]
fn generate_completions() {
2022-02-14 21:47:20 +00:00
let mut cmd = Command::new("test_app")
.arg(Arg::new("config").short('c').global(true))
.arg(Arg::new("v").short('v').conflicts_with("config"))
.subcommand(
2022-02-12 03:48:29 +00:00
Command::new("test")
.about("Subcommand")
.arg(Arg::new("debug").short('d')),
);
2022-02-14 21:47:20 +00:00
generate(Fig, &mut cmd, "test_app", &mut io::sink());
}