mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
18 lines
512 B
Rust
18 lines
512 B
Rust
use clap::{Arg, Command};
|
|
use clap_complete::generate;
|
|
use clap_complete_fig::Fig;
|
|
use std::io;
|
|
|
|
#[test]
|
|
fn generate_completions() {
|
|
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(
|
|
Command::new("test")
|
|
.about("Subcommand")
|
|
.arg(Arg::new("debug").short('d')),
|
|
);
|
|
|
|
generate(Fig, &mut cmd, "test_app", &mut io::sink());
|
|
}
|