/// <summary> /// Gets value for filter <paramref name="filter"/>. /// </summary> /// <param name="filter"></param> /// <returns>value of the filter.</returns> /// <exception cref="ArgumentException">when <paramref name="filter"/> is not among <see cref="AppliedFilters"/>.</exception> internal string GetFilterValue(FilterOptionDefinition filter) { if (!_filters.ContainsKey(filter)) { throw new ArgumentException($"{nameof(filter)} is not available in parse result.", nameof(filter)); } return(_filters[filter].GetValueOrDefault <string>() ?? string.Empty); }
protected override Option GetFilterOption(FilterOptionDefinition def) { return(ParentCommand.LegacyFilters[def]); }
/// <summary> /// Gets token name used for filter <paramref name="filter"/>. /// </summary> /// <param name="filter"></param> /// <returns>Token or null when token cannot be evaluated.</returns> internal string?GetFilterToken(FilterOptionDefinition filter) { return(_filters[filter].Token?.Value); }