diff options
| author | Rémy Tassoux <rt2@rt2.fr> | 2017-12-23 18:02:35 +0100 |
|---|---|---|
| committer | Rémy Tassoux <rt2@rt2.fr> | 2017-12-23 18:02:35 +0100 |
| commit | 6699ddabb1b3cf753401a79d6da544437e3b2994 (patch) | |
| tree | 028538f9816f3e6254fae945210f4e3f9ff2db01 /toolsrc/src/vcpkg.cpp | |
| parent | 40245cde8cde51897d8f79971b2b8c917dab399d (diff) | |
| parent | 544e99310d9f183b4add85c360de2df65ba64598 (diff) | |
| download | vcpkg-6699ddabb1b3cf753401a79d6da544437e3b2994.tar.gz vcpkg-6699ddabb1b3cf753401a79d6da544437e3b2994.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 08dd3fcf6..094ea1dc5 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -4,7 +4,7 @@ #pragma warning(push) #pragma warning(disable : 4768) -#include <ShlObj.h> +#include <Shlobj.h> #pragma warning(pop) #else #include <unistd.h> @@ -21,8 +21,10 @@ #include <vcpkg/metrics.h> #include <vcpkg/paragraphs.h> #include <vcpkg/userconfig.h> +#include <vcpkg/vcpkglib.h> #include <cassert> +#include <fstream> #include <memory> #include <random> @@ -47,7 +49,7 @@ static void inner(const VcpkgCmdArguments& args) Checks::exit_fail(VCPKG_LINE_INFO); } - static const auto FIND_COMMAND = [&](auto&& commands) { + static const auto find_command = [&](auto&& commands) { auto it = Util::find_if(commands, [&](auto&& commandc) { return Strings::case_insensitive_ascii_equals(commandc.name, args.command); }); @@ -60,7 +62,7 @@ static void inner(const VcpkgCmdArguments& args) return static_cast<decltype(&*it)>(nullptr); }; - if (const auto command_function = FIND_COMMAND(Commands::get_available_commands_type_c())) + if (const auto command_function = find_command(Commands::get_available_commands_type_c())) { return command_function->function(args); } @@ -134,7 +136,7 @@ static void inner(const VcpkgCmdArguments& args) } } - if (const auto command_function = FIND_COMMAND(Commands::get_available_commands_type_b())) + if (const auto command_function = find_command(Commands::get_available_commands_type_b())) { return command_function->function(args, paths); } @@ -159,7 +161,7 @@ static void inner(const VcpkgCmdArguments& args) Input::check_triplet(default_triplet, paths); - if (const auto command_function = FIND_COMMAND(Commands::get_available_commands_type_a())) + if (const auto command_function = find_command(Commands::get_available_commands_type_a())) { return command_function->function(args, paths, default_triplet); } @@ -212,7 +214,7 @@ static void load_config() static std::string trim_path_from_command_line(const std::string& full_command_line) { Checks::check_exit( - VCPKG_LINE_INFO, !full_command_line.empty(), "Internal failure - cannot have empty command line"); + VCPKG_LINE_INFO, full_command_line.size() > 0, "Internal failure - cannot have empty command line"); if (full_command_line[0] == '"') { |
