mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 03:27:12 +01:00
[autocomplete] Don't try to autocomplete triplets to --options
This commit is contained in:
parent
abd2cd26e7
commit
7a4023f1dc
@ -134,7 +134,8 @@ namespace vcpkg::Commands::Autocomplete
|
|||||||
const auto prefix = match[2].str();
|
const auto prefix = match[2].str();
|
||||||
std::vector<std::string> results;
|
std::vector<std::string> results;
|
||||||
|
|
||||||
if (Strings::case_insensitive_ascii_starts_with(prefix, "-"))
|
const bool is_option = Strings::case_insensitive_ascii_starts_with(prefix, "-");
|
||||||
|
if (is_option)
|
||||||
{
|
{
|
||||||
results = Util::fmap(command.structure.switches, [](auto&& s) -> std::string { return s; });
|
results = Util::fmap(command.structure.switches, [](auto&& s) -> std::string { return s; });
|
||||||
}
|
}
|
||||||
@ -147,7 +148,7 @@ namespace vcpkg::Commands::Autocomplete
|
|||||||
return Strings::case_insensitive_ascii_starts_with(s, prefix);
|
return Strings::case_insensitive_ascii_starts_with(s, prefix);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (command.name == "install" && results.size() == 1)
|
if (command.name == "install" && results.size() == 1 && !is_option)
|
||||||
{
|
{
|
||||||
const auto port_at_each_triplet =
|
const auto port_at_each_triplet =
|
||||||
combine_port_with_triplets(results[0], paths.get_available_triplets());
|
combine_port_with_triplets(results[0], paths.get_available_triplets());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user