Martin Sebor wrote:
Andrew Black wrote:
Greetings Martin
I've glanced over the patch and have attached a revised version that I
feel is a tad more consistent.
What? The consistency of my patch being challenged?! ;-)
* Invalid/missing options error messages are now routed through the
(new) bad_value and missing_value functions. I prefer these to
calling terminate(), as they also display the usage instructions when
the option is incorrectly used.
I don't think we should be displaying the entire help screen for
each typo. I have reservations about doing that for invalid option,
let alone for their arguments. The help text is long and might drown
out the error message itself. It's also not how most implementations
of utilities behave. So unless you have a really good argument for
doing so I'll remove this bit.
*shrug* I'm not too attached to displaying the full usage instructions.
An advantage of creating the additional help functions is you can
alter the behavior in one or two places as whims change, rather than
having to hunt down all the places changes are required. I suppose my
reason for dumping the full help text is so the user can know what is
expected, but the text might not be as helpful on that score as it could be.
--Andrew Black