Table of Contents

Class AnsiCli

Namespace
NanoByte.Common
Assembly
NanoByte.Common.AnsiCli.dll

Helper methods for ANSI console rendering.

public static class AnsiCli
Inheritance
object
AnsiCli

Properties

Error

Used to write to the standard error stream.

public static IAnsiConsole Error { get; }

Property Value

IAnsiConsole

Methods

Prompt<T>(TextPrompt<T>, CancellationToken)

Displays a prompt to the user.

public static T Prompt<T>(TextPrompt<T> prompt, CancellationToken cancellationToken)

Parameters

prompt TextPrompt<T>

The prompt to display.

cancellationToken CancellationToken

Used to cancel the prompt.

Returns

T

The prompt input result.

Type Parameters

T

The prompt result type.

Table<T>(IEnumerable<T>)

Formats data as a table.

public static IRenderable Table<T>(IEnumerable<T> data)

Parameters

data IEnumerable<T>

The data to format.

Returns

IRenderable

Type Parameters

T

Title(string)

Formats text as a title.

public static IRenderable Title(string title)

Parameters

title string

Returns

IRenderable

Tree<T>(NamedCollection<T>, char)

Formats data as a tree.

public static IRenderable Tree<T>(NamedCollection<T> data, char separator = '|') where T : INamed

Parameters

data NamedCollection<T>

The data to show as nodes in the tree.

separator char

The character used to split Names into tree levels.

Returns

IRenderable

Type Parameters

T