Skip to content

Commit

Permalink
Set error output to red.
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed Jun 26, 2024
1 parent e70f9ba commit 58103de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions LenovoLegionToolkit.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,16 @@ private static void OnException(Exception ex, InvocationContext context)
_ => -99
};

if (!Console.IsOutputRedirected)
{
Console.ResetColor();
Console.ForegroundColor = ConsoleColor.Red;
}

context.Console.Error.WriteLine(message);
context.ExitCode = exitCode;

if (!Console.IsOutputRedirected)
Console.ResetColor();
}
}

0 comments on commit 58103de

Please sign in to comment.