Skip to content

Commit 1a1a842

Browse files
authored
Merge pull request #3698 from epage/value
fix(complete): Complete visible, rather than hidden, values
2 parents 17b930c + b266e6d commit 1a1a842

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clap_complete/src/shells/bash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn vals_for(o: &Arg) -> String {
178178
format!(
179179
"$(compgen -W \"{}\" -- \"${{cur}}\")",
180180
vals.iter()
181-
.filter(|pv| pv.is_hide_set())
181+
.filter(|pv| !pv.is_hide_set())
182182
.map(PossibleValue::get_name)
183183
.collect::<Vec<_>>()
184184
.join(" ")

clap_complete/tests/snapshots/sub_subcommands.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ _my-app() {
9494
fi
9595
case "${prev}" in
9696
--config)
97-
COMPREPLY=($(compgen -W "" -- "${cur}"))
97+
COMPREPLY=($(compgen -W "Lest quotes aren't escaped." -- "${cur}"))
9898
return 0
9999
;;
100100
*)

clap_complete/tests/snapshots/value_hint.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _my-app() {
2626
fi
2727
case "${prev}" in
2828
--choice)
29-
COMPREPLY=($(compgen -W "" -- "${cur}"))
29+
COMPREPLY=($(compgen -W "bash fish zsh" -- "${cur}"))
3030
return 0
3131
;;
3232
--unknown)

0 commit comments

Comments
 (0)