Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ See '<bright-cyan,bold>cargo help</> <cyan><<command>></>' for more information
.action(ArgAction::SetTrue)
.global(true)
.hide(true))
.arg(multi_opt("config", "KEY=VALUE|PATH", "Override a configuration value").global(true))
.arg(multi_opt("config", "KEY=VALUE|PATH", "Override a configuration value").value_hint(clap::ValueHint::FilePath).global(true))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one thing worth discussion. According to the doc:

Note: To maintain consistency with existing .cargo/config.toml probing behavior, it is by design that a path in a config file passed via --config is also relative to two levels up from the config file itself.

So personally would expect people usually put their extra config under .cargo/ or .config/. Not sure if this means that we might want to have custom completer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we filter for these, they'll be shown first but all other dirs will still be shown but after.

Whats more of a problem is that it hides the candidates of hidden files and directories. In that state, they are only shown if there are no visible candidates.

I might want to add an override for this in clap. It would be easy to say "don't hide for this completer" but that will then show everything when likely only a subset is wanted. I could have a separate hide function that takes a predicate to override the default hide behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Better suggestion for the unsupported lowercase unstable feature flag.
.arg( Arg::new("unsupported-lowercase-unstable-feature-flag")
.help("")
Expand Down