Table of Contents

Method WriteLine

Namespace
Ploch.CommandLine.Spectre.Output
Assembly
Ploch.CommandLine.Spectre.dll

WriteLine()

Writes a line break to the output.

[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global", Justification = "Part of the public API for consumers' commands; the library stopped calling it when the command preamble moved to standard error (PLO-783).")]
IOutput WriteLine()

Returns

IOutput

The current output instance for method chaining.

WriteLine<TMessage>(TMessage)

Writes a message to the output followed by a line break.

IOutput WriteLine<TMessage>(TMessage message)

Parameters

message TMessage

The message to write.

Returns

IOutput

The current output instance for method chaining.

Type Parameters

TMessage

The type of the message.

Remarks

The message takes the same path as in Write<TMessage>(TMessage, IFormatProvider?), through the registered IMessageWriter for its type, so a string is written verbatim by default and a custom writer for a type applies here too. The line break is added afterwards unless the writer reports WritesLineTerminator. To render markup, call MarkupLine(string) or MarkupLineInterpolated(FormattableString). An interpolated string literal infers string here, so WriteLine($"[green]ok[/]") prints the tags; pass it as WriteLine<FormattableString>($"...") to take the interpolated-markup path.