CliWriter Class
Definition
- Namespace
- DotMake.CommandLine
- Assembly
- DotMake.CommandLine.dll
Represents a CLI writer that provides styled terminal output (color and text decoration), using ANSI escape sequences when supported and console-native fallbacks otherwise.
public class CliWriter : DelegatingTextWriter, IAsyncDisposable, IDisposable
- Inheritance
-
CliWriter
- Implements
Constructors
| CliWriter(TextWriter, bool) |
Initializes a new instance of the CliWriter class. |
Fields
| Inner | (Inherited from DelegatingTextWriter) |
Properties
| Encoding |
When overridden in a derived class, returns the character encoding in which the output is written. (Inherited from DelegatingTextWriter) |
| FormatProvider |
Gets an object that controls formatting. (Inherited from DelegatingTextWriter) |
| NewLine |
Gets or sets the line terminator string used by the current |
Methods
| DisposeAsync() |
Asynchronously releases all resources used by the TextWriter object. (Inherited from DelegatingTextWriter) |
| Flush() |
Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. (Inherited from DelegatingTextWriter) |
| FlushAsync() |
Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device. (Inherited from DelegatingTextWriter) |
| GetCached(TextWriter) |
Gets a cached CliWriter instance for a TextWriter instance. This way ANSI capabilities will be detected only once (which may be an expensive operation) for Out, for example. The cache entry will be removed when the TextWriter instance becomes unreachable. |
| ResetStyle() |
Resets terminal output styling (color and text decoration) to the default style. |
| SetStyle(CliStyle) |
Applies the specified style (color and text decoration) to subsequent terminal output. |
| Write(CliStyle, string) |
Writes a string with the specified style (color and text decoration), to the terminal. |
| Write(CliStyle, string, params object[]) |
Writes a formatted string with the specified style (color and text decoration), to the terminal. |
| WriteLine() |
Writes a line terminator to the text stream. (Inherited from DelegatingTextWriter) |
| WriteLine(CliStyle, string) |
Writes a string with the specified style (color and text decoration), followed by the current line terminator, to the terminal. |
| WriteLine(CliStyle, string, params object[]) |
Writes a formatted string with the specified style (color and text decoration), followed by the current line terminator, to the terminal. |
| WriteLineAsync() |
Asynchronously writes a line terminator to the text stream. (Inherited from DelegatingTextWriter) |
| WriteLink(CliLink, CliStyle, string) |
Writes a string as link with URL with the specified style (color and text decoration), to the terminal. |
| WriteLink(CliLink, CliStyle, string, params object[]) |
Writes a formatted string as link with URL with the specified style (color and text decoration), to the terminal. |
| WriteLink(CliLink, string) |
Writes a string as link with URL, to the terminal. |
| WriteLink(CliLink, string, params object[]) |
Writes a formatted string as link with URL, to the terminal. |