mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
chore: use filename of argv0 in UsageInformation
This commit is contained in:
parent
32480a75eb
commit
5fee875495
@ -139,9 +139,9 @@ LinkerArgs::LinkerArgs()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinkerArgs::PrintUsage()
|
void LinkerArgs::PrintUsage() const
|
||||||
{
|
{
|
||||||
UsageInformation usage("Linker.exe");
|
UsageInformation usage(m_argument_parser.GetExecutableName());
|
||||||
|
|
||||||
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* \brief Prints a command line usage help text for the Linker tool to stdout.
|
* \brief Prints a command line usage help text for the Linker tool to stdout.
|
||||||
*/
|
*/
|
||||||
static void PrintUsage();
|
void PrintUsage() const;
|
||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
void SetBinFolder(const char* argv0);
|
void SetBinFolder(const char* argv0);
|
||||||
|
@ -69,9 +69,9 @@ RawTemplaterArguments::RawTemplaterArguments()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RawTemplaterArguments::PrintUsage()
|
void RawTemplaterArguments::PrintUsage() const
|
||||||
{
|
{
|
||||||
UsageInformation usage("RawTemplater.exe");
|
UsageInformation usage(m_argument_parser.GetExecutableName());
|
||||||
|
|
||||||
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ class RawTemplaterArguments
|
|||||||
/**
|
/**
|
||||||
* \brief Prints a command line usage help text for the RawTemplater tool to stdout.
|
* \brief Prints a command line usage help text for the RawTemplater tool to stdout.
|
||||||
*/
|
*/
|
||||||
static void PrintUsage();
|
void PrintUsage() const;
|
||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -151,9 +151,9 @@ UnlinkerArgs::UnlinkerArgs()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnlinkerArgs::PrintUsage()
|
void UnlinkerArgs::PrintUsage() const
|
||||||
{
|
{
|
||||||
UsageInformation usage("Unlinker.exe");
|
UsageInformation usage(m_argument_parser.GetExecutableName());
|
||||||
|
|
||||||
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* \brief Prints a command line usage help text for the Unlinker tool to stdout.
|
* \brief Prints a command line usage help text for the Unlinker tool to stdout.
|
||||||
*/
|
*/
|
||||||
static void PrintUsage();
|
void PrintUsage() const;
|
||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
void SetVerbose(bool isVerbose);
|
void SetVerbose(bool isVerbose);
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
#include "Utils/StringUtils.h"
|
#include "Utils/StringUtils.h"
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <format>
|
#include <format>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
constexpr auto PREFIX_LONG = "--";
|
constexpr auto PREFIX_LONG = "--";
|
||||||
constexpr auto PREFIX_SHORT = "-";
|
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();
|
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::string GetValueForOption(const CommandLineOption* option) const;
|
||||||
std::vector<std::string> GetParametersForOption(const CommandLineOption* option) const;
|
std::vector<std::string> GetParametersForOption(const CommandLineOption* option) const;
|
||||||
|
|
||||||
|
[[nodiscard]] std::string GetExecutableName() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<const CommandLineOption*> m_command_line_options;
|
std::vector<const CommandLineOption*> m_command_line_options;
|
||||||
std::map<const CommandLineOption*, std::vector<std::string>> m_matched_options;
|
std::map<const CommandLineOption*, std::vector<std::string>> m_matched_options;
|
||||||
|
@ -118,9 +118,9 @@ ZoneCodeGeneratorArguments::ZoneCodeGeneratorArguments()
|
|||||||
m_verbose = false;
|
m_verbose = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneCodeGeneratorArguments::PrintUsage()
|
void ZoneCodeGeneratorArguments::PrintUsage() const
|
||||||
{
|
{
|
||||||
UsageInformation usage("ZoneCodeGenerator.exe");
|
UsageInformation usage(m_argument_parser.GetExecutableName());
|
||||||
|
|
||||||
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
for (const auto* commandLineOption : COMMAND_LINE_OPTIONS)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ class ZoneCodeGeneratorArguments
|
|||||||
/**
|
/**
|
||||||
* \brief Prints a command line usage help text for the Unlinker tool to stdout.
|
* \brief Prints a command line usage help text for the Unlinker tool to stdout.
|
||||||
*/
|
*/
|
||||||
static void PrintUsage();
|
void PrintUsage() const;
|
||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user