diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-18 14:47:04 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-18 14:53:10 -0700 |
| commit | 7a4023f1dcb3686d7d8deaf9e40cc0283e508b08 (patch) | |
| tree | 5aeb30c62aa3ce4fa453e7c2a9ae142bdfba7702 | |
| parent | abd2cd26e7992e8d859fad612a7ecacc14ce5364 (diff) | |
| download | vcpkg-7a4023f1dcb3686d7d8deaf9e40cc0283e508b08.tar.gz vcpkg-7a4023f1dcb3686d7d8deaf9e40cc0283e508b08.zip | |
[autocomplete] Don't try to autocomplete triplets to --options
| -rw-r--r-- | toolsrc/src/vcpkg/commands.autocomplete.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index e36bf8430..410bfcd0d 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -134,7 +134,8 @@ namespace vcpkg::Commands::Autocomplete const auto prefix = match[2].str(); 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; }); } @@ -147,7 +148,7 @@ namespace vcpkg::Commands::Autocomplete 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 = combine_port_with_triplets(results[0], paths.get_available_triplets()); |
