2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-30 16:27:47 +00:00

feat: verbose option sets log level to debug

This commit is contained in:
Jan Laupetin
2025-09-11 22:17:56 +02:00
parent 02f20f09b6
commit d693ace12f
13 changed files with 29 additions and 57 deletions

View File

@@ -79,8 +79,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{
};
ImageConverterArgs::ImageConverterArgs()
: m_verbose(false),
m_game_to_convert_to(image_converter::Game::UNKNOWN),
: m_game_to_convert_to(image_converter::Game::UNKNOWN),
m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>)
{
}
@@ -105,11 +104,6 @@ void ImageConverterArgs::PrintVersion()
con::info("OpenAssetTools ImageConverter {}", GIT_VERSION);
}
void ImageConverterArgs::SetVerbose(const bool isVerbose)
{
m_verbose = isVerbose;
}
bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
{
shouldContinue = true;
@@ -144,7 +138,10 @@ bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shou
}
// -v; --verbose
SetVerbose(m_argument_parser.IsOptionSpecified(OPTION_VERBOSE));
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
con::globalLogLevel = con::LogLevel::DEBUG;
else
con::globalLogLevel = con::LogLevel::INFO;
return true;
}

View File

@@ -25,7 +25,6 @@ public:
ImageConverterArgs();
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
bool m_verbose;
std::vector<std::string> m_files_to_convert;
image_converter::Game m_game_to_convert_to;
@@ -36,7 +35,5 @@ private:
static void PrintUsage();
static void PrintVersion();
void SetVerbose(bool isVerbose);
ArgumentParser m_argument_parser;
};