Skip to content

IGlobalOptionsAccessor

Provides typed access to parsed global option values. Values are updated after each global option parsing pass.

public interface IGlobalOptionsAccessor

Gets all parsed global option names that have values in the current invocation.

IEnumerable<string> GetOptionNames()

IEnumerable<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)
  • name (string): The registered option name (without -- prefix).

IReadOnlyList<string>

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)
  • T: Target value type.
  • name (string): The registered option name (without -- prefix).
  • defaultValue (T): Value to return if the option was not provided.

T

Returns true if the named global option was explicitly provided in the current invocation.

bool HasValue(string name)
  • name (string): The registered option name (without -- prefix).

bool