diff --git a/src/Linker/LinkerArgs.cpp b/src/Linker/LinkerArgs.cpp index 4617dfbb..d8addde4 100644 --- a/src/Linker/LinkerArgs.cpp +++ b/src/Linker/LinkerArgs.cpp @@ -7,6 +7,7 @@ #include "Utils/FileUtils.h" #include +#include #include #include #include @@ -155,7 +156,7 @@ void LinkerArgs::PrintUsage() void LinkerArgs::PrintVersion() { - std::cout << "OpenAssetTools Linker " << std::string(GIT_VERSION) << "\n"; + std::cout << std::format("OpenAssetTools Linker {}\n", GIT_VERSION); } void LinkerArgs::SetBinFolder(const char* argv0) diff --git a/src/RawTemplater/RawTemplaterArguments.cpp b/src/RawTemplater/RawTemplaterArguments.cpp index d3879b10..8f297346 100644 --- a/src/RawTemplater/RawTemplaterArguments.cpp +++ b/src/RawTemplater/RawTemplaterArguments.cpp @@ -4,38 +4,55 @@ #include "Utils/Arguments/CommandLineOption.h" #include "Utils/Arguments/UsageInformation.h" +#include #include #include +// clang-format off const CommandLineOption* const OPTION_HELP = - CommandLineOption::Builder::Create().WithShortName("?").WithLongName("help").WithDescription("Displays usage information.").Build(); + CommandLineOption::Builder::Create() + .WithShortName("?") + .WithLongName("help") + .WithDescription("Displays usage information.") + .Build(); const CommandLineOption* const OPTION_VERSION = - CommandLineOption::Builder::Create().WithLongName("version").WithDescription("Prints the application version.").Build(); + CommandLineOption::Builder::Create() + .WithLongName("version") + .WithDescription("Prints the application version.") + .Build(); const CommandLineOption* const OPTION_VERBOSE = - CommandLineOption::Builder::Create().WithShortName("v").WithLongName("verbose").WithDescription("Outputs a lot more and more detailed messages.").Build(); + CommandLineOption::Builder::Create() + .WithShortName("v") + .WithLongName("verbose") + .WithDescription("Outputs a lot more and more detailed messages.") + .Build(); -const CommandLineOption* const OPTION_OUTPUT_FOLDER = CommandLineOption::Builder::Create() - .WithShortName("o") - .WithLongName("output") - .WithDescription("Specify the folder to save the generated files. Defaults to the current directory.") - .WithParameter("outputPath") - .Build(); +const CommandLineOption* const OPTION_OUTPUT_FOLDER = + CommandLineOption::Builder::Create() + .WithShortName("o") + .WithLongName("output") + .WithDescription("Specify the folder to save the generated files. Defaults to the current directory.") + .WithParameter("outputPath") + .Build(); -const CommandLineOption* const OPTION_BUILD_LOG = CommandLineOption::Builder::Create() - .WithLongName("build-log") - .WithDescription("Specify a file to write a build log to.") - .WithParameter("logFilePath") - .Build(); +const CommandLineOption* const OPTION_BUILD_LOG = + CommandLineOption::Builder::Create() + .WithLongName("build-log") + .WithDescription("Specify a file to write a build log to.") + .WithParameter("logFilePath") + .Build(); -const CommandLineOption* const OPTION_DEFINE = CommandLineOption::Builder::Create() - .WithShortName("d") - .WithLongName("define") - .WithDescription("Adds a define for the templating process. Can be of format define or define=value.") - .WithParameter("defineValue") - .Reusable() - .Build(); +const CommandLineOption* const OPTION_DEFINE = + CommandLineOption::Builder::Create() + .WithShortName("d") + .WithLongName("define") + .WithDescription("Adds a define for the templating process. Can be of format define or define=value.") + .WithParameter("defineValue") + .Reusable() + .Build(); +// clang-format on const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, @@ -66,7 +83,7 @@ void RawTemplaterArguments::PrintUsage() void RawTemplaterArguments::PrintVersion() { - std::cout << "OpenAssetTools RawTemplater " << std::string(GIT_VERSION) << "\n"; + std::cout << std::format("OpenAssetTools RawTemplater {}\n", GIT_VERSION); } bool RawTemplaterArguments::ParseArgs(const int argc, const char** argv, bool& shouldContinue) @@ -122,9 +139,9 @@ bool RawTemplaterArguments::ParseArgs(const int argc, const char** argv, bool& s const auto separator = arg.find('='); if (separator != std::string::npos) - m_defines.emplace_back(std::make_pair(arg.substr(0, separator), arg.substr(separator + 1))); + m_defines.emplace_back(arg.substr(0, separator), arg.substr(separator + 1)); else - m_defines.emplace_back(std::make_pair(arg, std::string())); + m_defines.emplace_back(arg, std::string()); } } diff --git a/src/Unlinker/UnlinkerArgs.cpp b/src/Unlinker/UnlinkerArgs.cpp index 43aac8f7..9f114da2 100644 --- a/src/Unlinker/UnlinkerArgs.cpp +++ b/src/Unlinker/UnlinkerArgs.cpp @@ -7,6 +7,7 @@ #include "Utils/FileUtils.h" #include "Utils/StringUtils.h" +#include #include #include #include @@ -167,7 +168,7 @@ void UnlinkerArgs::PrintUsage() void UnlinkerArgs::PrintVersion() { - std::cout << "OpenAssetTools Unlinker " << std::string(GIT_VERSION) << "\n"; + std::cout << std::format("OpenAssetTools Unlinker {}\n", GIT_VERSION); } void UnlinkerArgs::SetVerbose(const bool isVerbose) diff --git a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp index 7be657fe..0dbe00ed 100644 --- a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp +++ b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp @@ -4,74 +4,83 @@ #include "Utils/Arguments/CommandLineOption.h" #include "Utils/Arguments/UsageInformation.h" +#include #include #include +// clang-format off const CommandLineOption* const OPTION_HELP = - CommandLineOption::Builder::Create().WithShortName("?").WithLongName("help").WithDescription("Displays usage information.").Build(); + CommandLineOption::Builder::Create() + .WithShortName("?") + .WithLongName("help") + .WithDescription("Displays usage information.") + .Build(); const CommandLineOption* const OPTION_VERSION = - CommandLineOption::Builder::Create().WithLongName("version").WithDescription("Prints the application version.").Build(); + CommandLineOption::Builder::Create() + .WithLongName("version") + .WithDescription("Prints the application version.") + .Build(); const CommandLineOption* const OPTION_VERBOSE = - CommandLineOption::Builder::Create().WithShortName("v").WithLongName("verbose").WithDescription("Outputs a lot more and more detailed messages.").Build(); + CommandLineOption::Builder::Create() + .WithShortName("v") + .WithLongName("verbose") + .WithDescription("Outputs a lot more and more detailed messages.") + .Build(); -// ------ -// INPUT -// ------ +constexpr auto CATEGORY_INPUT = "Input"; -constexpr const char* CATEGORY_INPUT = "Input"; +const CommandLineOption* const OPTION_HEADER = + CommandLineOption::Builder::Create() + .WithShortName("h") + .WithLongName("header") + .WithDescription("Reads from the specified header file.") + .WithCategory(CATEGORY_INPUT) + .WithParameter("headerFile") + .Reusable() + .Build(); -const CommandLineOption* const OPTION_HEADER = CommandLineOption::Builder::Create() - .WithShortName("h") - .WithLongName("header") - .WithDescription("Reads from the specified header file.") - .WithCategory(CATEGORY_INPUT) - .WithParameter("headerFile") - .Reusable() - .Build(); +const CommandLineOption* const OPTION_COMMANDS_FILE = + CommandLineOption::Builder::Create() + .WithShortName("c") + .WithLongName("commands-file") + .WithDescription("Specifies the commands file. Defaults to stdin.") + .WithCategory(CATEGORY_INPUT) + .WithParameter("commandFile") + .Reusable() + .Build(); -const CommandLineOption* const OPTION_COMMANDS_FILE = CommandLineOption::Builder::Create() - .WithShortName("c") - .WithLongName("commands-file") - .WithDescription("Specifies the commands file. Defaults to stdin.") - .WithCategory(CATEGORY_INPUT) - .WithParameter("commandFile") - .Reusable() - .Build(); - -// ------ -// OUTPUT -// ------ -constexpr const char* CATEGORY_OUTPUT = "Output"; +constexpr auto CATEGORY_OUTPUT = "Output"; const CommandLineOption* const OPTION_OUTPUT_FOLDER = CommandLineOption::Builder::Create() - .WithShortName("o") - .WithLongName("output") - .WithDescription("Specify the folder to save the generate code files to. Defaults to the current directory.") - .WithCategory(CATEGORY_OUTPUT) - .WithParameter("outputPath") - .Build(); + .WithShortName("o") + .WithLongName("output") + .WithDescription("Specify the folder to save the generate code files to. Defaults to the current directory.") + .WithCategory(CATEGORY_OUTPUT) + .WithParameter("outputPath") + .Build(); -const CommandLineOption* const OPTION_PRINT = CommandLineOption::Builder::Create() - .WithShortName("p") - .WithLongName("print") - .WithDescription("Print the loaded data.") - .WithCategory(CATEGORY_OUTPUT) - .Build(); +const CommandLineOption* const OPTION_PRINT = + CommandLineOption::Builder::Create() + .WithShortName("p") + .WithLongName("print") + .WithDescription("Print the loaded data.") + .WithCategory(CATEGORY_OUTPUT) + .Build(); const CommandLineOption* const OPTION_GENERATE = CommandLineOption::Builder::Create() - .WithShortName("g") - .WithLongName("generate") - .WithDescription("Generates a specified asset/preset combination. Can be used multiple times. Available presets: " - "ZoneLoad, ZoneWrite, AssetStructTests") - .WithCategory(CATEGORY_OUTPUT) - .WithParameter("assetName") - .WithParameter("preset") - .Reusable() - .Build(); + .WithShortName("g") + .WithLongName("generate") + .WithDescription("Generates a specified asset/preset combination. Can be used multiple times. Available presets: ZoneLoad, ZoneWrite, AssetStructTests") + .WithCategory(CATEGORY_OUTPUT) + .WithParameter("assetName") + .WithParameter("preset") + .Reusable() + .Build(); +// clang-format on const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, @@ -123,7 +132,7 @@ void ZoneCodeGeneratorArguments::PrintUsage() void ZoneCodeGeneratorArguments::PrintVersion() { - std::cout << "OpenAssetTools ZoneCodeGenerator " << std::string(GIT_VERSION) << "\n"; + std::cout << std::format("OpenAssetTools ZoneCodeGenerator {}\n", GIT_VERSION); } bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bool& shouldContinue)