mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-30 16:27:47 +00:00
feat: add command line option to disable color output
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user