Adds support for force color argument
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/tag Build is failing Details

This commit is contained in:
Deukhoofd 2021-09-07 19:17:00 +02:00
parent 7e1597531d
commit e386078eb6
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ int main(int argc, char** argv) {
args::ValueFlag<std::string> workingDirFlag(parser, "Working Directory", "Which work directory to use.", args::ValueFlag<std::string> workingDirFlag(parser, "Working Directory", "Which work directory to use.",
{"workdir"}); {"workdir"});
args::Flag logTimeFlag(parser, "time-log", "Whether to show time logging.", {'t', "time-log"}); args::Flag logTimeFlag(parser, "time-log", "Whether to show time logging.", {'t', "time-log"});
args::Flag forceColorFlag(parser, "force-color", "Whether to force color text output.", {'c', "force-color"});
try { try {
parser.ParseCLI(argc, argv); parser.ParseCLI(argc, argv);
} catch (args::Help&) { } catch (args::Help&) {
@ -42,6 +43,9 @@ int main(int argc, char** argv) {
if (!workingDirectory.empty()) { if (!workingDirectory.empty()) {
chdir((const char*)std::filesystem::path(workingDirectory).c_str()); chdir((const char*)std::filesystem::path(workingDirectory).c_str());
} }
if (forceColorFlag.Get()){
termcolor::colorize(std::cout);
}
std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
std::function<void(PkmnLib::Battling::ScriptResolver*)> initialize = std::function<void(PkmnLib::Battling::ScriptResolver*)> initialize =