argh icon indicating copy to clipboard operation
argh copied to clipboard

A few help and error reporting improvements

Open optimistiCli opened this issue 1 year ago • 0 comments

Hi!

I've added a few features related to help and error reporting:

  1. a new ‘help_text’ attribute that denotes a pseudo-argument containing the generated help – it comes handy if you need to construct “long help”;
  2. a new TopLevelCommand instance method ‘report_error_and_exit‘ – helps with reporting higher level errors / inconsistencies in (combinations of) arguments;
  3. a new ‘verbose_error‘ attribute – it harmonizes the internal error reporting style with ‘report_error_and_exit‘ output for UI consistency.

I've included an example utilising all of these additions at argh/examples/help_text_example.rs, please check it out.

Hope you find it useful.

optimistiCli avatar Apr 13 '24 17:04 optimistiCli