mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
test(complete): Help for possible value
This commit is contained in:
parent
65b9c2b37d
commit
aa3f47c239
1 changed files with 5 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::path::Path;
|
||||
|
||||
use clap::Command;
|
||||
use clap::{builder::PossibleValue, Command};
|
||||
|
||||
macro_rules! complete {
|
||||
($cmd:expr, $input:expr$(, current_dir = $current_dir:expr)? $(,)?) => {
|
||||
|
@ -61,13 +61,13 @@ fn suggest_long_flag_subset() {
|
|||
fn suggest_possible_value_subset() {
|
||||
let name = "exhaustive";
|
||||
let mut cmd = Command::new(name).arg(clap::Arg::new("hello-world").value_parser([
|
||||
"hello-world",
|
||||
"hello-moon",
|
||||
"goodbye-world",
|
||||
PossibleValue::new("hello-world").help("Say hello to the world"),
|
||||
"hello-moon".into(),
|
||||
"goodbye-world".into(),
|
||||
]));
|
||||
|
||||
snapbox::assert_eq(
|
||||
"hello-world
|
||||
"hello-world\tSay hello to the world
|
||||
hello-moon",
|
||||
complete!(cmd, "hello"),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue