зеркало из https://github.com/microsoft/vcpkg.git
Introduce Input::check_triplet()
This commit is contained in:
Родитель
d31498d0e7
Коммит
4b0f3d87be
|
@ -1,11 +1,13 @@
|
|||
#pragma once
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "package_spec.h"
|
||||
#include "vcpkg_paths.h"
|
||||
|
||||
namespace vcpkg {namespace Input
|
||||
{
|
||||
package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const char* example_text);
|
||||
|
||||
std::vector<package_spec> check_and_get_package_specs(const std::vector<std::string>& package_specs_as_strings, const triplet& default_target_triplet, const char* example_text);
|
||||
|
||||
void check_triplet(const triplet& t, const vcpkg_paths& paths);
|
||||
}}
|
||||
|
|
|
@ -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()))
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче