Re: [PATCH 1/4] Add a simple option parser for use by builtin-commit.c.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> wrote Mon, Oct 01, 2007:
> On Mon, 1 Oct 2007, Kristian H?gsberg wrote:
> > On Sun, 2007-09-30 at 15:11 +0200, Jonas Fonseca wrote:
> > > > +
> > > > +extern int parse_options(const char ***argv,
> > > > +			 struct option *options, int count,
> > > > +			 const char *usage_string);
> > > 
> > > I think the interface could be improved a bit. For example, it doesn't 
> > > need to count argument since the last entry in the options array is 
> > > OPTION_LAST and thus the size can be detected that way.
> > 
> > Hehe, yeah, that's how I did it first.  I don't have a strong preference 
> > for terminator elements vs. ARRAY_SIZE(), but Junio prefers the 
> > ARRAY_SIZE() approach, I guess.  At this point I'm just trying the get 
> > the patches upstream...
> 
> FWIW I like the ARRAY_SIZE() approach better, too, since it is less error 
> prone.

OK, I must have missed that comment. Good point.

Thanks for the comments both of you. It's great to have something to
work from. However, I also fear it will also require that some extra
flags or information is added to the option information to make it more
generally usable. But I guess that is easier to discuss in the context
of a patch.

-- 
Jonas Fonseca
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux