diff options
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/main.cpp | 9 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Input.cpp | 13 |
2 files changed, 15 insertions, 7 deletions
diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index a317330ff..b49f2bdef 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -11,6 +11,7 @@ #include <Shlobj.h> #include "vcpkg_Files.h" #include "vcpkg_System.h" +#include "vcpkg_Input.h" using namespace vcpkg; @@ -87,13 +88,7 @@ static void inner(const vcpkg_cmd_arguments& args) } } - if (!paths.is_valid_triplet(default_target_triplet)) - { - System::println(System::color::error, "Error: invalid triplet: %s", default_target_triplet.value); - TrackProperty("error", "invalid triplet: " + default_target_triplet.value); - help_topic_valid_triplet(paths); - exit(EXIT_FAILURE); - } + Input::check_triplet(default_target_triplet, paths); if (auto command_function = find_command(args.command, get_available_commands_type_a())) { diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index de5890da1..09fce7b8c 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -1,5 +1,7 @@ #include "vcpkg_Input.h" #include "vcpkg_System.h" +#include "metrics.h" +#include "vcpkg_Commands.h" namespace vcpkg {namespace Input { @@ -26,4 +28,15 @@ namespace vcpkg {namespace Input return specs; } + + void check_triplet(const triplet& t, const vcpkg_paths& paths) + { + if (!paths.is_valid_triplet(t)) + { + System::println(System::color::error, "Error: invalid triplet: %s", t.value); + TrackProperty("error", "invalid triplet: " + t.value); + help_topic_valid_triplet(paths); + exit(EXIT_FAILURE); + } + } }} |
