VirtualTerminal.WriteLineErrorFormatted Method

Writes a line to the standard error stream which, if virtual terminal sequences are supported, will use the specified formatting.

Definition

Namespace: Ookii.CommandLine.Terminal
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.1.0+9df03b6173b5fc9d44dc39638758964dd7a0f4c7
C#
public static void WriteLineErrorFormatted(
	string text,
	TextFormat? textFormat = null,
	TextFormat? reset = null
)

Parameters

text  String
The text to write.
textFormat  Nullable<TextFormat>  (Optional)
The formatting that should be applied to the text, or null to use TextFormat.ForegroundRed.
reset  Nullable<TextFormat>  (Optional)
The VT sequence that should be used to undo the formatting, or null to use TextFormat.Default.

Remarks

This method takes care of checking whether VT sequences are supported by using the EnableColor(StandardStream) method, and on Windows, will reset the console mode afterwards if needed.

The textFormat and reset parameters will be ignored if the standard error stream does not support VT sequences. In that case, the value of text will be written without formatting.

See Also