IGlobalOptionsAccessor
Provides typed access to parsed global option values. Values are updated after each global option parsing pass.
- Kind:
Interface - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/IGlobalOptionsAccessor.cs
Signature
Section titled “Signature”public interface IGlobalOptionsAccessorMethods
Section titled “Methods”GetOptionNames()
Section titled “GetOptionNames()”Gets all parsed global option names that have values in the current invocation.
IEnumerable<string> GetOptionNames()Returns
Section titled “Returns”IEnumerable<string>
GetRawValues(string)
Section titled “GetRawValues(string)”Gets all raw string values for a global option (supports repeated options). Returns an empty list if the option was not provided.
IReadOnlyList<string> GetRawValues(string name)Parameters
Section titled “Parameters”name(string): The registered option name (without--prefix).
Returns
Section titled “Returns”IReadOnlyList<string>
GetValue<T>(string, T?)
Section titled “GetValue<T>(string, T?)”Gets the typed value of a global option by its registered name. Returns defaultValue if the option was not provided.
T? GetValue<T>(string name, T? defaultValue = default)Type Parameters
Section titled “Type Parameters”T: Target value type.
Parameters
Section titled “Parameters”name(string): The registered option name (without--prefix).defaultValue(T): Value to return if the option was not provided.
Returns
Section titled “Returns”T
HasValue(string)
Section titled “HasValue(string)”Returns true if the named global option was explicitly provided in the current invocation.
bool HasValue(string name)Parameters
Section titled “Parameters”name(string): The registered option name (without--prefix).