Table of Contents

Class ToolCommand

Namespace
DotNetDo
Assembly
DotNetDo.Core.dll

Base value object for rendering and awaiting a command-line tool invocation.

public abstract record ToolCommand : ExecOptions, IEquatable<ExecOptions>, IEquatable<ToolCommand>

Inheritance

Derived

Implements

Properties

AdditionalArguments

Unstructured arguments appended after typed options.

public string? AdditionalArguments { get; init; }

Property Value

string?

CommandParts

Gets every canonically ordered rendered command fragment.

protected abstract IReadOnlyList<string?> CommandParts { get; }

Property Value

IReadOnlyList<string?>

Methods

Arg(string, bool)

Renders an argument when enabled.

protected static string? Arg(string argument, bool value)

Parameters

argument string
value bool

Returns

string?

Arg(string, string, bool?)

Renders one of two arguments for a nullable choice.

protected static string? Arg(string trueValue, string falseValue, bool? value)

Parameters

trueValue string
falseValue string
value bool?

Returns

string?

Arg<T>(string, T?, bool)

Renders one typed semantic value.

protected static string? Arg<T>(string prefix, T? value, bool quote = true)

Parameters

prefix string
value T?
quote bool

Returns

string?

Type Parameters

T

Arg<T>(T?, bool)

Renders one typed positional semantic value.

protected static string? Arg<T>(T? value, bool quote = true)

Parameters

value T?
quote bool

Returns

string?

Type Parameters

T

Args<T>(IEnumerable<T>, string, bool)

Renders typed positional semantic values independently, then joins them.

protected static string? Args<T>(IEnumerable<T> values, string separator = " ", bool quote = true)

Parameters

values IEnumerable<T>
separator string
quote bool

Returns

string?

Type Parameters

T

Args<T>(string, IEnumerable<T>, string, bool)

Renders typed semantic values independently, then joins them.

protected static string? Args<T>(string prefix, IEnumerable<T> values, string separator = " ", bool quote = true)

Parameters

prefix string
values IEnumerable<T>
separator string
quote bool

Returns

string?

Type Parameters

T

ToString()

Returns a string that represents the current object.

public override sealed string ToString()

Returns

string

A string that represents the current object.