2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-01-13 20:21:48 +00:00

chore: use filename of argv0 in UsageInformation

This commit is contained in:
Jan
2024-09-23 23:05:04 +02:00
parent 32480a75eb
commit 5fee875495
10 changed files with 22 additions and 12 deletions

View File

@@ -2,11 +2,14 @@
#include "Utils/StringUtils.h"
#include <filesystem>
#include <format>
#include <iostream>
#include <sstream>
#include <string>
namespace fs = std::filesystem;
constexpr auto PREFIX_LONG = "--";
constexpr auto PREFIX_SHORT = "-";
@@ -169,3 +172,8 @@ bool ArgumentParser::IsOptionSpecified(const CommandLineOption* option) const
{
return m_matched_options.find(option) != m_matched_options.end();
}
std::string ArgumentParser::GetExecutableName() const
{
return fs::path(m_path).filename().string();
}

View File

@@ -19,6 +19,8 @@ public:
std::string GetValueForOption(const CommandLineOption* option) const;
std::vector<std::string> GetParametersForOption(const CommandLineOption* option) const;
[[nodiscard]] std::string GetExecutableName() const;
private:
std::vector<const CommandLineOption*> m_command_line_options;
std::map<const CommandLineOption*, std::vector<std::string>> m_matched_options;