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

Peter Wang novalazy at gmail.com
Tue Apr 10 01:31:00 PDT 2012


On Tue, 10 Apr 2012 00:22:01 -0700, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Thu, Apr 05 2012, Peter Wang <novalazy at 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


More information about the notmuch mailing list