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
CommandParts
Gets every canonically ordered rendered command fragment.
protected abstract IReadOnlyList<string?> CommandParts { get; }Property Value
Methods
Arg(string, bool)
Renders an argument when enabled.
protected static string? Arg(string argument, bool value)Parameters
Returns
Arg(string, string, bool?)
Renders one of two arguments for a nullable choice.
protected static string? Arg(string trueValue, string falseValue, bool? value)Parameters
Returns
Arg<T>(string, T?, bool)
Renders one typed semantic value.
protected static string? Arg<T>(string prefix, T? value, bool quote = true)Parameters
Returns
Type Parameters
T
Arg<T>(T?, bool)
Renders one typed positional semantic value.
protected static string? Arg<T>(T? value, bool quote = true)Parameters
valueT?quotebool
Returns
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
valuesIEnumerable<T>separatorstringquotebool
Returns
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
prefixstringvaluesIEnumerable<T>separatorstringquotebool
Returns
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.