Make use of escape codes configurable
This commit is contained in:
parent
b1b071aba8
commit
163abf3b02
|
@ -163,6 +163,7 @@ int main(int argc, char *argv[])
|
|||
SET_APPLICATION_INFO;
|
||||
QT_CONFIG_ARGUMENTS qtConfigArgs;
|
||||
HelpArgument helpArg(parser);
|
||||
NoColorArgument noColorArg;
|
||||
// verbose option
|
||||
Argument verboseArg("verbose", 'v', "be verbose");
|
||||
verboseArg.setCombinable(true);
|
||||
|
@ -230,7 +231,7 @@ int main(int argc, char *argv[])
|
|||
qtConfigArgs.qtWidgetsGuiArg().setAbbreviation('\0');
|
||||
qtConfigArgs.qtWidgetsGuiArg().addSubArgument(&defaultFileArg);
|
||||
qtConfigArgs.qtWidgetsGuiArg().addSubArgument(&renamingUtilityArg);
|
||||
parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &printFieldNamesArg, &displayFileInfoArg, &displayTagInfoArg, &setTagInfoArgs.setTagInfoArg, &extractFieldArg, &genInfoArg, &helpArg});
|
||||
parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &printFieldNamesArg, &displayFileInfoArg, &displayTagInfoArg, &setTagInfoArgs.setTagInfoArg, &extractFieldArg, &genInfoArg, &noColorArg, &helpArg});
|
||||
// parse given arguments
|
||||
parser.parseArgsOrExit(argc, argv);
|
||||
if(qtConfigArgs.areQtGuiArgsPresent()) {
|
||||
|
|
|
@ -80,7 +80,11 @@ void InterruptHandler::handler(int signum)
|
|||
logLineFinalized = true;
|
||||
write(STDOUT_FILENO, "\n", 1);
|
||||
}
|
||||
write(STDOUT_FILENO, "\e[1;33mWarning:\e[0m \e[1mInterrupt received, trying to abort ongoing process ...\e[0m\n", 84);
|
||||
if(EscapeCodes::enabled) {
|
||||
write(STDOUT_FILENO, "\e[1;33mWarning:\e[0m \e[1mInterrupt received, trying to abort ongoing process ...\e[0m\n", 84);
|
||||
} else {
|
||||
write(STDOUT_FILENO, "Warning: Interrupt received, trying to abort ongoing process ...\n", 65);
|
||||
}
|
||||
|
||||
// call custom handler
|
||||
s_handler();
|
||||
|
|
Loading…
Reference in New Issue