mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-03 20:59:01 +08:00
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "OptBool.h"
|
|
#include <memory>
|
|
#include <unordered_set>
|
|
#include <vector>
|
|
|
|
namespace vcpkg
|
|
{
|
|
struct VcpkgCmdArguments
|
|
{
|
|
static VcpkgCmdArguments create_from_command_line(const int argc, const wchar_t* const* const argv);
|
|
static VcpkgCmdArguments create_from_arg_sequence(const std::string* arg_begin, const std::string* arg_end);
|
|
|
|
std::unique_ptr<std::string> vcpkg_root_dir;
|
|
std::unique_ptr<std::string> triplet;
|
|
OptBool debug = OptBoolC::UNSPECIFIED;
|
|
OptBool sendmetrics = OptBoolC::UNSPECIFIED;
|
|
OptBool printmetrics = OptBoolC::UNSPECIFIED;
|
|
|
|
std::string command;
|
|
std::vector<std::string> command_arguments;
|
|
std::unordered_set<std::string>
|
|
check_and_get_optional_command_arguments(const std::vector<std::string>& valid_options) 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;
|
|
void check_min_arg_count(const size_t expected_arg_count) const;
|
|
void check_min_arg_count(const size_t expected_arg_count, const std::string& example_text) const;
|
|
void check_exact_arg_count(const size_t expected_arg_count) const;
|
|
void check_exact_arg_count(const size_t expected_arg_count, const std::string& example_text) const;
|
|
|
|
private:
|
|
std::unordered_set<std::string> optional_command_arguments;
|
|
};
|
|
}
|