On Tue, 10 Apr 2012 00:22:01 -0700, Jameson Graef Rollins 
<jroll...@finestructure.net> wrote:
> On Thu, Apr 05 2012, Peter Wang <noval...@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
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to