@@ -11,22 +11,22 @@ use super::CompletionCandidate;
11
11
///
12
12
/// ```rust
13
13
/// use clap::Parser;
14
- /// use clap_complete::engine::{ArgValueCompleter , CompletionCandidate};
14
+ /// use clap_complete::engine::{ArgValueCandidates , CompletionCandidate};
15
15
///
16
16
/// #[derive(Debug, Parser)]
17
17
/// struct Cli {
18
- /// #[arg(long, add = ArgValueCompleter ::new(|| { vec![
18
+ /// #[arg(long, add = ArgValueCandidates ::new(|| { vec![
19
19
/// CompletionCandidate::new("foo"),
20
20
/// CompletionCandidate::new("bar"),
21
21
/// CompletionCandidate::new("baz")] }))]
22
22
/// custom: Option<String>,
23
23
/// }
24
24
/// ```
25
25
#[ derive( Clone ) ]
26
- pub struct ArgValueCompleter ( Arc < dyn ValueCandidates > ) ;
26
+ pub struct ArgValueCandidates ( Arc < dyn ValueCandidates > ) ;
27
27
28
- impl ArgValueCompleter {
29
- /// Create a new `ArgValueCompleter ` with a custom completer
28
+ impl ArgValueCandidates {
29
+ /// Create a new `ArgValueCandidates ` with a custom completer
30
30
pub fn new < C > ( completer : C ) -> Self
31
31
where
32
32
C : ValueCandidates + ' static ,
@@ -42,15 +42,15 @@ impl ArgValueCompleter {
42
42
}
43
43
}
44
44
45
- impl std:: fmt:: Debug for ArgValueCompleter {
45
+ impl std:: fmt:: Debug for ArgValueCandidates {
46
46
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
47
47
f. write_str ( type_name :: < Self > ( ) )
48
48
}
49
49
}
50
50
51
- impl ArgExt for ArgValueCompleter { }
51
+ impl ArgExt for ArgValueCandidates { }
52
52
53
- /// User-provided completion candidates for an [`Arg`][clap::Arg], see [`ArgValueCompleter `]
53
+ /// User-provided completion candidates for an [`Arg`][clap::Arg], see [`ArgValueCandidates `]
54
54
///
55
55
/// This is useful when predefined value hints are not enough.
56
56
pub trait ValueCandidates : Send + Sync {
0 commit comments