opts-common.c's cmdline_handle_error handles invalid arguments
for options with CL_ERR_ENUM_ARG by building a strings listing the
valid arguments. By also building a vec of valid arguments, we
can use find_closest_string and provide a hint if we see a close
misspelling.
Successfully bootstrapped®
On 05/09/2016 06:14 PM, David Malcolm wrote:
opts-common.c's cmdline_handle_error handles invalid arguments
for options with CL_ERR_ENUM_ARG by building a strings listing the
valid arguments. By also building a vec of valid arguments, we
can use find_closest_string and provide a hint if we see a
On Mon, May 09, 2016 at 08:14:47PM -0400, David Malcolm wrote:
> - inform (loc, "valid arguments to %qs are: %s", option->opt_text, s);
> + const char *hint = find_closest_string (arg, &candidates);
> + if (hint)
> + inform (loc, "valid arguments to %qs are: %s; did you mean %qs
On Tue, 2016-05-10 at 22:09 +0200, Bernhard Reutner-Fischer wrote:
> On Mon, May 09, 2016 at 08:14:47PM -0400, David Malcolm wrote:
>
> > - inform (loc, "valid arguments to %qs are: %s", option
> > ->opt_text, s);
> > + const char *hint = find_closest_string (arg, &candidates);
> > +
On 10/05/16 22:03, David Malcolm wrote:
On Tue, 2016-05-10@22:09 +0200, Bernhard Reutner-Fischer wrote:
On Mon, May 09, 2016@08:14:47PM -0400, David Malcolm wrote:
- inform (loc, "valid arguments to %qs are: %s", option
->opt_text, s);
+ const char *hint = find_closest_string (arg, &