From #2046:
Currently the only way for the users to implement custom directives is enabling directives parsing in the config, using this property to get parsed output:
|
public IReadOnlyDictionary<string, IReadOnlyList<string>> Directives => _directives ??= new (); |
and provide a custom, expensive Middleware.
We need to introduce a dedicated Directive type that derives from Symbol.
Initial requirements:
From #2046:
Currently the only way for the users to implement custom directives is enabling directives parsing in the config, using this property to get parsed output:
command-line-api/src/System.CommandLine/ParseResult.cs
Line 86 in 76437b0
and provide a custom, expensive Middleware.
We need to introduce a dedicated
Directivetype that derives fromSymbol.Initial requirements:
Directivesymbol type, with a possibility to define anAction<ParseResult, string>which should be executed when directive is parsed (the list of arguments for the action is an open question, when implementing the feature it should became more obvious)Command.Directivesproperty to allow users for defining directivescommand-line-api/src/System.CommandLine/Parsing/ParseOperation.cs
Lines 350 to 378 in 76437b0