Joseph Musser

Results 395 comments of Joseph Musser

@jonsequitur I haven't figured out middleware yet. It's odd that you wouldn't be able to add middleware to a root command using an API exposed on the root command instance.

Can we have a Configuration property on the root command and set `UseDefaultExceptionHandler = false`?

I think I figured out how to use middleware. Is this right? ```cs return await new CommandLineBuilder(rootCommand) .UseDefaults() .UseExceptionHandler((exception, context) => context.ResultCode = ExceptionHandler(exception)) .Build() .InvokeAsync(args); ``` (I missed the...

If it's really imperative that the root command can't have configuration attached to it, what if I could do something like ASP.NET's configuration APIs? ```cs return await rootCommand .Configure(config =>...

Wouldn't it work the same way as the builder already works? Last person to call Build() wins? ```cs new CommandLineBuilder(rootCommand) .UseExceptionHandler(x) .Build(); new CommandLineBuilder(rootCommand) .UseExceptionHandler(y) .Build(); ```

`Command.InvokeAsync` already effectively performs a `new CommandLineBuilder(command)...Build()` behind the scenes (even if that's not literally what it does). Something is already happening; I just want a way to pass parameters...

Knowing what I know now, I also don't honestly see a conceptual difference between: ```cs var rootCommand = new RootCommand { subcommand1, subcommand2, ... }; rootCommand.Configuration.CrossCuttingStuff(...); return await rootCommand.InvokeAsync(args); ```...

I apologize for the amount I'm commenting, but I realized that I don't want the ability to use `try`...`catch` rather than passing a handler delegate. The reason is that the...

> Not a fan of the '!' operator on the GetMethod calls. But let us assume that MS won't rename/remove those methods. I am actually a fan of this and...

@manfred-brands I'm not against making helpers that throw with nice messages instead of returning null, but I wouldn't personally do this in place of using `!` every time I use...