[getopt-sig] Documentation, functionality, options, syncing
A.T. Hofkamp
a.t.hofkamp@tue.nl
Thu, 21 Feb 2002 15:22:31 +0100 (CET)
On Wed, 20 Feb 2002, Greg Ward wrote:
> Note that lines are nicely wrapped to 80 columns. (Actually it's 78,
> and yes it is hard-coded -- despite getting some useful answers on
> c.l.py, I haven't gotten around to actually coding any of the 14
> different ways to find out how big the terminal is.) (You can see the
Shouldn't that be part of the line-wrapping library ?
>
> HelpFormatter, but that's irrelevant to the API. Yes, it ties you to
> having your help in the same order as your options are defined. I think
> that's a feature: it ties documentation clarity to code clarity; as one
> increases (decreases), so does the other. Can you think of an example
> where you would want to define options in a different order than you
> would document them?
Ok, what about a multi-lingual program ?
I don't have much experience in this area, but I can imagine that the help of
an option should be available in multiple languages. All text in the program is
collected in 1 file for each language, and I have a unique key that finds the
text when I want to output a message.
Can I store the key as help text in the option ?
Another case is that I have written a frontend program that handles several
different types of files. The help text of the program does not only print the
options, but also the types of files it understands, with a description of what
it does with each type as a seperate piece of text. How does that fit in your
integrated help ?
I think the problem is not that it may not be useful to organize help text like
you do, but that it is an all-or-nothing option. If I want to use it, I need
the help to fit in the format/layout you designed. That may work tody, but what
about tomorrow ?
If I don't want to use the help texts, I must start from scratch, which is a
waste of time, since I probably could use some of the functionality.
I think it should be possible to give a bit more freedom, i.e. use a part of
it, and do the other stuff myself.
For example, allow querying the help text for (a list of) options (formatted or
non-formatted), thus allowing the use to write his own usage() (formatting)
code using information you manage.
Albert
--
Constructing a computer program is like writing a painting