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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user