Skip to content

Commit

Permalink
Merge pull request #3698 from epage/value
Browse files Browse the repository at this point in the history
fix(complete): Complete visible, rather than hidden, values
  • Loading branch information
epage authored May 6, 2022
2 parents 17b930c + b266e6d commit 1a1a842
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clap_complete/src/shells/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fn vals_for(o: &Arg) -> String {
format!(
"$(compgen -W \"{}\" -- \"${{cur}}\")",
vals.iter()
.filter(|pv| pv.is_hide_set())
.filter(|pv| !pv.is_hide_set())
.map(PossibleValue::get_name)
.collect::<Vec<_>>()
.join(" ")
Expand Down
2 changes: 1 addition & 1 deletion clap_complete/tests/snapshots/sub_subcommands.bash
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ _my-app() {
fi
case "${prev}" in
--config)
COMPREPLY=($(compgen -W "" -- "${cur}"))
COMPREPLY=($(compgen -W "Lest quotes aren't escaped." -- "${cur}"))
return 0
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion clap_complete/tests/snapshots/value_hint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _my-app() {
fi
case "${prev}" in
--choice)
COMPREPLY=($(compgen -W "" -- "${cur}"))
COMPREPLY=($(compgen -W "bash fish zsh" -- "${cur}"))
return 0
;;
--unknown)
Expand Down

0 comments on commit 1a1a842

Please sign in to comment.