[PATCH] cli: make the command line parser's errors more informative.

2012-06-05 Thread Peter Wang
On Sun, 3 Jun 2012 12:48:48 +0100, Mark Walters wrote: > > +static notmuch_bool_t > +_process_int_arg (const notmuch_opt_desc_t *arg_desc, char next, const char > *arg_str) { > + > +char *endptr; > +if (next == 0 || arg_str[0] == 0) { > + fprintf (stderr, "Option \"%s\" needs an i

[PATCH] cli: make the command line parser's errors more informative.

2012-06-05 Thread Mark Walters
On Tue, 05 Jun 2012, Peter Wang wrote: > On Sun, 3 Jun 2012 12:48:48 +0100, Mark Walters gmail.com> wrote: >> >> +static notmuch_bool_t >> +_process_int_arg (const notmuch_opt_desc_t *arg_desc, char next, const char >> *arg_str) { >> + >> +char *endptr; >> +if (next == 0 || arg_str[0

Re: [PATCH] cli: make the command line parser's errors more informative.

2012-06-05 Thread Mark Walters
On Tue, 05 Jun 2012, Peter Wang wrote: > On Sun, 3 Jun 2012 12:48:48 +0100, Mark Walters > wrote: >> >> +static notmuch_bool_t >> +_process_int_arg (const notmuch_opt_desc_t *arg_desc, char next, const char >> *arg_str) { >> + >> +char *endptr; >> +if (next == 0 || arg_str[0] == 0)

Re: [PATCH] cli: make the command line parser's errors more informative.

2012-06-05 Thread Peter Wang
On Sun, 3 Jun 2012 12:48:48 +0100, Mark Walters wrote: > > +static notmuch_bool_t > +_process_int_arg (const notmuch_opt_desc_t *arg_desc, char next, const char > *arg_str) { > + > +char *endptr; > +if (next == 0 || arg_str[0] == 0) { > + fprintf (stderr, "Option \"%s\" needs an i

[PATCH] cli: make the command line parser's errors more informative.

2012-06-03 Thread Mark Walters
Previously, the cli parser was a little erratic in what errors it reported and would fail silently in many cases (for example, when no argument was passed to an integer option). This was particularly annoying as the user could not (easily) tell whether the command failed or just there were no searc

[PATCH] cli: make the command line parser's errors more informative.

2012-06-03 Thread Mark Walters
Previously, the cli parser was a little erratic in what errors it reported and would fail silently in many cases (for example, when no argument was passed to an integer option). This was particularly annoying as the user could not (easily) tell whether the command failed or just there were no searc