#include "dawn/utils/CommandLineParser.h"
#include <algorithm>
#include <tuple>
#include "absl/container/flat_hash_map.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
namespace dawn::utils {
CommandLineParser::OptionBase::OptionBase(std::string_view name, std::string_view desc)
: … { … }
CommandLineParser::OptionBase::~OptionBase() = default;
const std::string& CommandLineParser::OptionBase::GetName() const { … }
std::string CommandLineParser::OptionBase::GetShortName() const { … }
const std::string& CommandLineParser::OptionBase::GetDescription() const { … }
std::string CommandLineParser::OptionBase::GetParameter() const { … }
bool CommandLineParser::OptionBase::IsSet() const { … }
CommandLineParser::OptionBase::ParseResult CommandLineParser::OptionBase::Parse(
absl::Span<const std::string_view> args) { … }
CommandLineParser::BoolOption::BoolOption(std::string_view name, std::string_view desc)
: … { … }
CommandLineParser::BoolOption::~BoolOption() = default;
bool CommandLineParser::BoolOption::GetValue() const { … }
std::string CommandLineParser::BoolOption::GetParameter() const { … }
CommandLineParser::OptionBase::ParseResult CommandLineParser::BoolOption::ParseImpl(
absl::Span<const std::string_view> args) { … }
CommandLineParser::StringOption::StringOption(std::string_view name, std::string_view desc)
: … { … }
CommandLineParser::StringOption::~StringOption() = default;
std::string CommandLineParser::StringOption::GetValue() const { … }
CommandLineParser::OptionBase::ParseResult CommandLineParser::StringOption::ParseImpl(
absl::Span<const std::string_view> args) { … }
CommandLineParser::StringListOption::StringListOption(std::string_view name, std::string_view desc)
: … { … }
CommandLineParser::StringListOption::~StringListOption() = default;
absl::Span<const std::string> CommandLineParser::StringListOption::GetValue() const { … }
std::vector<std::string> CommandLineParser::StringListOption::GetOwnedValue() const { … }
CommandLineParser::OptionBase::ParseResult CommandLineParser::StringListOption::ParseImpl(
absl::Span<const std::string_view> args) { … }
CommandLineParser::BoolOption& CommandLineParser::AddBool(std::string_view name,
std::string_view desc) { … }
CommandLineParser::StringOption& CommandLineParser::AddString(std::string_view name,
std::string_view desc) { … }
CommandLineParser::StringListOption& CommandLineParser::AddStringList(std::string_view name,
std::string_view desc) { … }
std::string CommandLineParser::JoinConversionNames(absl::Span<const std::string_view> names,
std::string_view separator) { … }
CommandLineParser::BoolOption& CommandLineParser::AddHelp() { … }
const CommandLineParser::ParseOptions CommandLineParser::kDefaultParseOptions = …;
CommandLineParser::ParseResult CommandLineParser::Parse(absl::Span<const std::string_view> args,
const ParseOptions& parseOptions) { … }
CommandLineParser::ParseResult CommandLineParser::Parse(const std::vector<std::string>& args,
const ParseOptions& parseOptions) { … }
CommandLineParser::ParseResult CommandLineParser::Parse(int argc,
const char** argv,
const ParseOptions& parseOptions) { … }
void CommandLineParser::PrintHelp(std::ostream& s) { … }
}