diff --git a/src/ImageConverter/ImageConverterArgs.cpp b/src/ImageConverter/ImageConverterArgs.cpp index 79ac8ad4..1f9a7816 100644 --- a/src/ImageConverter/ImageConverterArgs.cpp +++ b/src/ImageConverter/ImageConverterArgs.cpp @@ -29,6 +29,12 @@ const CommandLineOption* const OPTION_VERBOSE = .WithDescription("Outputs a lot more and more detailed messages.") .Build(); +const CommandLineOption* const OPTION_NO_COLOR = + CommandLineOption::Builder::Create() + .WithLongName("no-color") + .WithDescription("Disables colored terminal output.") + .Build(); + constexpr auto CATEGORY_GAME = "Game"; const CommandLineOption* const OPTION_GAME_IW3 = @@ -71,6 +77,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, OPTION_VERSION, OPTION_VERBOSE, + OPTION_NO_COLOR, OPTION_GAME_IW3, OPTION_GAME_IW4, OPTION_GAME_IW5, @@ -143,5 +150,8 @@ bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shou else con::globalLogLevel = con::LogLevel::INFO; + // --no-color + con::globalUseColor = !m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR); + return true; } diff --git a/src/Linker/LinkerArgs.cpp b/src/Linker/LinkerArgs.cpp index 80f9134d..d363c75c 100644 --- a/src/Linker/LinkerArgs.cpp +++ b/src/Linker/LinkerArgs.cpp @@ -36,6 +36,12 @@ const CommandLineOption* const OPTION_VERBOSE = .WithDescription("Outputs a lot more and more detailed messages.") .Build(); +const CommandLineOption* const OPTION_NO_COLOR = + CommandLineOption::Builder::Create() + .WithLongName("no-color") + .WithDescription("Disables colored terminal output.") + .Build(); + const CommandLineOption* const OPTION_BASE_FOLDER = CommandLineOption::Builder::Create() .WithShortName("b") @@ -116,6 +122,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, OPTION_VERSION, OPTION_VERBOSE, + OPTION_NO_COLOR, OPTION_BASE_FOLDER, OPTION_OUTPUT_FOLDER, OPTION_ADD_ASSET_SEARCH_PATH, @@ -200,6 +207,9 @@ bool LinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContin else con::globalLogLevel = con::LogLevel::INFO; + // --no-color + con::globalUseColor = !m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR); + // b; --base-folder if (m_argument_parser.IsOptionSpecified(OPTION_BASE_FOLDER)) m_base_folder = m_argument_parser.GetValueForOption(OPTION_BASE_FOLDER); diff --git a/src/RawTemplater/RawTemplaterArguments.cpp b/src/RawTemplater/RawTemplaterArguments.cpp index f36af8de..a933b425 100644 --- a/src/RawTemplater/RawTemplaterArguments.cpp +++ b/src/RawTemplater/RawTemplaterArguments.cpp @@ -30,6 +30,12 @@ const CommandLineOption* const OPTION_VERBOSE = .WithDescription("Outputs a lot more and more detailed messages.") .Build(); +const CommandLineOption* const OPTION_NO_COLOR = + CommandLineOption::Builder::Create() + .WithLongName("no-color") + .WithDescription("Disables colored terminal output.") + .Build(); + const CommandLineOption* const OPTION_OUTPUT_FOLDER = CommandLineOption::Builder::Create() .WithShortName("o") @@ -59,6 +65,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, OPTION_VERSION, OPTION_VERBOSE, + OPTION_NO_COLOR, OPTION_OUTPUT_FOLDER, OPTION_BUILD_LOG, OPTION_DEFINE, @@ -124,6 +131,9 @@ bool RawTemplaterArguments::ParseArgs(const int argc, const char** argv, bool& s else con::globalLogLevel = con::LogLevel::INFO; + // --no-color + con::globalUseColor = !m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR); + // -o; --output if (m_argument_parser.IsOptionSpecified(OPTION_OUTPUT_FOLDER)) m_output_directory = m_argument_parser.GetValueForOption(OPTION_OUTPUT_FOLDER); diff --git a/src/Unlinker/UnlinkerArgs.cpp b/src/Unlinker/UnlinkerArgs.cpp index 4b3d81d5..3ae9224f 100644 --- a/src/Unlinker/UnlinkerArgs.cpp +++ b/src/Unlinker/UnlinkerArgs.cpp @@ -34,6 +34,12 @@ const CommandLineOption* const OPTION_VERBOSE = .WithDescription("Outputs a lot more and more detailed messages.") .Build(); +const CommandLineOption* const OPTION_NO_COLOR = + CommandLineOption::Builder::Create() + .WithLongName("no-color") + .WithDescription("Disables colored terminal output.") + .Build(); + const CommandLineOption* const OPTION_MINIMAL_ZONE_FILE = CommandLineOption::Builder::Create() .WithShortName("min") @@ -125,6 +131,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, OPTION_VERSION, OPTION_VERBOSE, + OPTION_NO_COLOR, OPTION_MINIMAL_ZONE_FILE, OPTION_LOAD, OPTION_LIST, @@ -300,6 +307,9 @@ bool UnlinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldCont else con::globalLogLevel = con::LogLevel::INFO; + // --no-color + con::globalUseColor = !m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR); + // -min; --minimal-zone m_minimal_zone_def = m_argument_parser.IsOptionSpecified(OPTION_MINIMAL_ZONE_FILE); diff --git a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp index 9e4d51ff..f508ba59 100644 --- a/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp +++ b/src/ZoneCodeGeneratorLib/ZoneCodeGeneratorArguments.cpp @@ -30,6 +30,12 @@ const CommandLineOption* const OPTION_VERBOSE = .WithDescription("Outputs a lot more and more detailed messages.") .Build(); +const CommandLineOption* const OPTION_NO_COLOR = + CommandLineOption::Builder::Create() + .WithLongName("no-color") + .WithDescription("Disables colored terminal output.") + .Build(); + constexpr auto CATEGORY_INPUT = "Input"; const CommandLineOption* const OPTION_HEADER = @@ -87,6 +93,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{ OPTION_HELP, OPTION_VERSION, OPTION_VERBOSE, + OPTION_NO_COLOR, OPTION_HEADER, OPTION_COMMANDS_FILE, OPTION_OUTPUT_FOLDER, @@ -170,6 +177,9 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo else con::globalLogLevel = con::LogLevel::INFO; + // --no-color + con::globalUseColor = !m_argument_parser.IsOptionSpecified(OPTION_NO_COLOR); + // -p; --print if (m_argument_parser.IsOptionSpecified(OPTION_PRINT)) m_task_flags |= FLAG_TASK_PRINT;