CLI11 icon indicating copy to clipboard operation
CLI11 copied to clipboard

Accumulation of errors for a better message

Open OlivierHartmann opened this issue 7 years ago • 9 comments

Hi, At parsing step, is it possible, to accumulate the errors, (such as missing required argument or conversion errors, and so on) in order to display all of them at the end at the same time ? For example, returning a big "CLI::ParsingError(error_string)" at the end with an error per line. In fact, behind the fact that it would be much much easier for the user to have all errors at once, I would like to have the parsing results (I mean, having the option variables filled, at least those given correctly in the command line). Is it easy to do something like that ? Thank you.

OlivierHartmann avatar Oct 12 '18 08:10 OlivierHartmann

Not at the moment. I would like to rework the error system to avoid using exceptions (at least requiring exceptions), at which point making a list of parsing errors would become possible.

henryiii avatar Oct 12 '18 08:10 henryiii

This would also help with #168; the issue there is that you want to fill in all the options before calling the help, but don't want to run into the "errors" like required arguments.

henryiii avatar Oct 12 '18 08:10 henryiii

Thank you for you're prompt reply. This is for the AFF3CT project that is stressing a lot your API with a lot of arguments and subcommands. I have some issues so I may contact you again soon.

About https://github.com/CLIUtils/CLI11/issues/168, I am already "hacking" the system to display all subcommands in the help even with a subcommand given in the command line.

OlivierHartmann avatar Oct 12 '18 08:10 OlivierHartmann

Sure. I'm hoping to get a patch release out around the end of the month with a few fixes. Reworking errors and the type system are longer term. Reasonable PRs happily accepted, too. :)

henryiii avatar Oct 12 '18 08:10 henryiii

Hello Henry, Where are you at in the development of the patch? I have a new tricky issue that I hope your patch will fix. I'm waiting for it before opening a new issue post. I'm looking forward to it :) Thank you

OlivierHartmann avatar Nov 12 '18 08:11 OlivierHartmann

I'll probably do a small patch release in a few days, then merge the new parse layout for 1.7.

henryiii avatar Nov 12 '18 20:11 henryiii

Thank you.

OlivierHartmann avatar Jan 06 '19 08:01 OlivierHartmann

This issue is now easier to address, but it's not fully addressed yet. Did the patch fix your tricky new issue?

henryiii avatar Jan 06 '19 09:01 henryiii

I'm sorry I am not on the AFF3CT project anymore. I can't test your patch. I am not sure that my colleagues will have time to take up this solution.

OlivierHartmann avatar Jan 06 '19 17:01 OlivierHartmann