Re: [PATCH v3 4/5] config: Add 'config list' command

Subject: Re: [PATCH v3 4/5] config: Add 'config list' command

Date: Tue, 10 Apr 2012 18:31:00 +1000

To: Jameson Graef Rollins

Cc: notmuch@notmuchmail.org

From: Peter Wang


On Tue, 10 Apr 2012 00:22:01 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> On Thu, Apr 05 2012, Peter Wang <novalazy@gmail.com> wrote:
> 
> > -    if (strcmp (argv[0], "get") == 0)
> > +    if (strcmp (argv[0], "get") == 0) {
> > +	if (argc < 2) {
> > +	    fprintf (stderr, "Error: notmuch config get requires at least "
> > +		     "two arguments.\n");
> > +	    return 1;
> > +	}
> >  	return notmuch_config_command_get (ctx, argv[1]);
> > -    else if (strcmp (argv[0], "set") == 0)
> > +    } else if (strcmp (argv[0], "set") == 0) {
> > +	if (argc < 2) {
> > +	    fprintf (stderr, "Error: notmuch config set requires at least "
> > +		     "two arguments.\n");
> > +	    return 1;
> > +	}
> >  	return notmuch_config_command_set (ctx, argv[1], argc - 2, argv + 2);
> 
> But then these changes look unrelated to me.  They do look good
> intentioned, though.  It's probably best to submit these changes in a
> separate unrelated patch.

Well, the only reason to duplicate the arity check is due to the
introduction of the 'list' subcommand.  But I see that the error
messages are wrong anyway, so I will separate out the changes in another
patch series.

Peter

Thread: