Struct OptionalParam<T>
- Namespace
- DotNetDo
- Assembly
- DotNetDo.Core.dll
An optional typed task parameter whose absence is represented by null.
public readonly record struct OptionalParam<T> : IEquatable<OptionalParam<T>> where T : notnullType Parameters
T
Properties
Description
Human-readable help text supplied by the task author.
public string? Description { get; }Property Value
Name
The parameter name.
public string Name { get; }Property Value
Value
The resolved parameter value, or null when absent.
public T? Value { get; }Property Value
- T?
Methods
QuotedArgument()
Renders the resolved optional value as one quoted command-line argument.
public string? QuotedArgument()Returns
Required()
Resolves the optional parameter, prompting during an interactive local build or throwing when no value is available.
public Param<T> Required()Returns
- Param<T>
Operators
implicit operator T?(OptionalParam<T>)
The resolved parameter value.
public static implicit operator T?(OptionalParam<T> parameter)Parameters
parameterOptionalParam<T>-
The optional parameter wrapper.
Returns
- T?