Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate ParserConfig into IParseValidator #52

Open
nemec opened this issue Mar 11, 2019 · 0 comments
Open

Integrate ParserConfig into IParseValidator #52

nemec opened this issue Mar 11, 2019 · 0 comments

Comments

@nemec
Copy link
Owner

nemec commented Mar 11, 2019

When building error messages during validation it may be helpful to refer to arguments by name in order to explain why parsing failed. Example:

Cannot use both -d/--delete and --move at the same time.

We already have the ability to refer to a strongly-typed name and value (e.g. nameof(opt.Delete) and opt.Delete), but the flags must be hardcoded. If we could pull them from the config, whenever it changes the validation message would automatically match.

Some notes:

  • Need the ability to access sub-config of verbs
  • Need to retrieve both the short and long names of a NamedArgument
  • Need to retrieve the meta name of a PositionalArgument
  • We might want to provide a facade over the complexity of IParserConfig and the IArguments and let users retrieve by name/namespace (e.g. config.GetArgumentFlags<Options>(opt => opt.Delete) == "-d/--delete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant