Skip to content

Consolidate redundant or ambiguous APIs #1127

@jonsequitur

Description

@jonsequitur

Remove the following APIs, as there are less ambiguous (all for the same reason outlined in #138) and more performant approaches are available (i.e. passing the Symbol for which you want results to overloads of these methods): (#1337)

  • ParseResultExtensions.HasOption(ParseResult, string) (Currently marked obsolete)
  • ParseResult.ValueForOption(string) (Currently marked obsolete)
  • ParseResult.ValueForOption<T>(string) (Currently marked obsolete)
  • ParseResult.ValueForArgument(string) (Currently marked obsolete)
  • ParseResult.ValueForArgument<T>(string) (Currently marked obsolete)
  • ParseResult[string]
  • CommandResult.OptionResult(string)
  • CommandResult[string]
  • ParseResult.ValueForOption<T>(Option)
  • ParseResult.ValueForArgument<T>(Argument)

Consider renaming the following APIs to GetValueOrDefault for consistency with the ArgumentResult.GetValueOrDefault and OptionResult.GetValueOrDefault extension methods. (#1394)

  • ParseResult.ValueForArgument<T>(Argument<T>) (Currently marked obsolete)
  • ParseResult.ValueForArgument(Argument) (Currently marked obsolete)
  • ParseResult.ValueForOption<T>(Option<T>) (Currently marked obsolete)
  • ParseResult.ValueForOption(Option option) (Currently marked obsolete)

Consider creating new methods for recursively looking up Symbol and/or SymbolResult instances by alias, e.g. (naming needs discussion):

- [ ] IEnumerable<ArgumentResult> ParseResult.FindArgumentResultsByName(string name)
- [ ] IEnumerable<OptionResult> ParseResult.FindOptionResultsByAlias(string alias)
- [ ] IEnumerable<ISymbol> CommandLineConfiguration.FindSymbolsByAlias(string alias)

Related: #138.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions