How to define behavior that is executed in case of a command-parsing error? [Question]
janca777 opened this issue · comments
Jan Gunnar Carstensen commented
On execution, my program takes two arguments it needs to run:
static Task<int> Main(string[] args)
{
return CommandLineApplication.ExecuteAsync<MyUpdateService>(args);
}
[Argument(0, Description = "Filepath")]
private string Filepath { get; }
[Argument(1, Description = "UpdateMode")]
private int Mode { get; }
I want to show a messagebox in case the program is run with too few/ too many arguments, or the arguments don't match the required types (1: string, 2: int).
Since this cannot be achieved by simply wrapping a try/catch-block around it: Can this be done?
Nate McMaster commented
Jan Gunnar Carstensen commented