mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-01-19 23:11:50 +00:00
fix: only show console color when supported
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "Persistence/IDataRepository.h"
|
||||
#include "Persistence/InMemory/InMemoryRepository.h"
|
||||
#include "Printing/PrettyPrinter.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "ZoneCodeGeneratorArguments.h"
|
||||
|
||||
#include <cstdio>
|
||||
@@ -23,6 +24,8 @@ public:
|
||||
|
||||
int Run(const int argc, const char** argv) override
|
||||
{
|
||||
con::init();
|
||||
|
||||
auto shouldContinue = true;
|
||||
if (!m_args.ParseArgs(argc, argv, shouldContinue))
|
||||
return 1;
|
||||
|
||||
@@ -173,12 +173,12 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo
|
||||
|
||||
// -v; --verbose
|
||||
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
|
||||
con::globalLogLevel = con::LogLevel::DEBUG;
|
||||
con::set_log_level(con::LogLevel::DEBUG);
|
||||
else
|
||||
con::globalLogLevel = con::LogLevel::INFO;
|
||||
con::set_log_level(con::LogLevel::INFO);
|
||||
|
||||
// --no-color
|
||||
con::globalUseColor = !m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR);
|
||||
con::set_use_color(!m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR));
|
||||
|
||||
// -p; --print
|
||||
if (m_argument_parser.IsOptionSpecified(OPTION_PRINT))
|
||||
|
||||
Reference in New Issue
Block a user