You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Providing custom validation messages using CommandLineBuilder #653
Is there a way to provide a custom validation message using CommandLineBuilder? From what I can see, there is a ValidationMessages.Instance that gets passed directly in the constructor of Parser and neither of CommandLineConfiguration property inside Parser or ValidationMessages property inside CommandLineConfiguration is setable.
If this is not possible, is there a way to create a Parser using CommandLineBuilder with my own instance of CommandLineConfiguration?
changed the title [-]Providing custom validation messages using `CommandLineBuilder`[/-][+]Providing custom validation messages using CommandLineBuilder[/+]on Oct 3, 2019
It would be straightforward to add this functionality to CommandLineBuilder.
In the meantime, you could create a CommandLineConfiguration directly, passing the ValidationMessages instance to its constructor. (CommandLineBuilder exists to help you compose arguments for the CommandLineConfiguration constructor, since CommandLineConfiguration is effectively immutable but has a somewhat complex constructor.)
Activity
[-]Providing custom validation messages using `CommandLineBuilder`[/-][+]Providing custom validation messages using CommandLineBuilder[/+]jonsequitur commentedon Oct 4, 2019
It would be straightforward to add this functionality to
CommandLineBuilder.In the meantime, you could create a
CommandLineConfigurationdirectly, passing theValidationMessagesinstance to its constructor. (CommandLineBuilderexists to help you compose arguments for theCommandLineConfigurationconstructor, sinceCommandLineConfigurationis effectively immutable but has a somewhat complex constructor.)mikelle-rogers commentedon Oct 15, 2021
@jonsequitur, was this issue fixed, or just closed? If it still needs to be fixed, I would be interested in learning about it.
Print help when a diagnostics tool is run without a command (#6132)