From 60296cf16189d4cb048482a1c4476a41d9b18918 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 26 Jul 2017 13:54:28 -0700 Subject: [vcpkg] Add support for single-option arguments. --- toolsrc/include/VcpkgCmdArguments.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/VcpkgCmdArguments.h b/toolsrc/include/VcpkgCmdArguments.h index 316987100..0de5747b1 100644 --- a/toolsrc/include/VcpkgCmdArguments.h +++ b/toolsrc/include/VcpkgCmdArguments.h @@ -2,11 +2,18 @@ #include "vcpkg_optional.h" #include +#include #include #include namespace vcpkg { + struct ParsedArguments + { + std::unordered_set switches; + std::unordered_map settings; + }; + struct VcpkgCmdArguments { static VcpkgCmdArguments create_from_command_line(const int argc, const wchar_t* const* const argv); @@ -21,7 +28,13 @@ namespace vcpkg std::string command; std::vector command_arguments; std::unordered_set check_and_get_optional_command_arguments( - const std::vector& valid_options) const; + const std::vector& valid_options) const + { + return std::move(check_and_get_optional_command_arguments(valid_options, {}).switches); + } + + ParsedArguments check_and_get_optional_command_arguments(const std::vector& valid_switches, + const std::vector& valid_settings) const; void check_max_arg_count(const size_t expected_arg_count) const; void check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const; @@ -31,6 +44,6 @@ namespace vcpkg void check_exact_arg_count(const size_t expected_arg_count, const std::string& example_text) const; private: - std::unordered_set optional_command_arguments; + std::unordered_map> optional_command_arguments; }; } -- cgit v1.2.3