[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gengetopt, anyone?
From: |
Bruno Haible |
Subject: |
Re: gengetopt, anyone? |
Date: |
Sun, 2 Oct 2011 21:56:48 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Hi Reuben,
> I notice no-one mentioned argp. (I also notice one of autoopts's
> testimonials says that it (autoopts) is simpler than argp!). But from
> a quick look argp seems rather neat; it doesn't need a separate parser
> and code generator, and it's available in gnulib.
>
> Why aren't I using it?
If you mean to ask "why are so few people using argp", here's the answer why
I'm not using 'argp' in GNU gettext, GNU libiconv:
1) When I introduce a new option, I have to do 5 modification:
- Add a variable that captures the value of that option.
- Implement the semantics of the option.
- Change main() and the getopt_long call to set said variable.
- Update the usage() message.
- Update the documentation.
AFAIU, 'argp' would allow me to combine 2 of these 5 steps, leaving only
4 steps. But 4 modifications is not much of a simplification over 5.
On the other hand, 'argp' has some complexity. I feel already saturated
with
getopt_long's complexity.
2) The 'argp' in glibc has some problem with internationalization, whereas the
'argp' in gnulib doesn't (fixed by Sergey on 2006-09-09). Quite confusing.
Bruno
--
In memoriam Bartolomé Blanco Márquez
<http://en.wikipedia.org/wiki/Bartolome_Blanco_Marquez>
- Re: gengetopt, anyone?, Reuben Thomas, 2011/10/01
- Re: gengetopt, anyone?, Bruce Korb, 2011/10/02
- Re: gengetopt, anyone?,
Bruno Haible <=
- Re: gengetopt, anyone?, Simon Josefsson, 2011/10/02
- Re: gengetopt, anyone?, Rhys Ulerich, 2011/10/02