Skip to content

Commit 0887593

Browse files
committed
fix(complete): Change ValueHint::Unknown to Other, from AnyPath
`AnyPath` is the documented behavior *but* thats to help when there isn't much other information. With us choosing a `ValueHint` based on the value parser, we are less likely to get benefit from `AnyPath`. Instead, this will greatly improve cases like Cargo where we offer path completions on many arguments where it doesn't make sense.
1 parent 61ebe72 commit 0887593

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clap_complete/src/engine/complete.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ fn complete_arg_value(
329329
}
330330
} else {
331331
match arg.get_value_hint() {
332-
clap::ValueHint::Other => {
332+
clap::ValueHint::Unknown | clap::ValueHint::Other => {
333333
// Should not complete
334334
}
335-
clap::ValueHint::Unknown | clap::ValueHint::AnyPath => {
335+
clap::ValueHint::AnyPath => {
336336
values.extend(complete_path(value_os, current_dir, &|_| true));
337337
}
338338
clap::ValueHint::FilePath => {

0 commit comments

Comments
 (0)