Re: [Structuredtext-develop] Some problems with option lists
Status: Pre-Alpha
Brought to you by:
goodger
From: Richard J. <rj...@ek...> - 2002-02-20 02:38:12
|
On Wed, 20 Feb 2002 12:42, David Goodger wrote: > Richard Jones wrote: > > 1. the leading dashes are removed from the short_option and long_option. > > Is this intentional? If so, I'll re-add the dashes, but it seems odd. > > Yes, it's intentional. The various option types are uniformly represented > in the tree. Once the options have been parsed into "long_option" or > "short_option" elements, the dashes are implicit; they're boilerplate text, > redundant and uninteresting. It's text to be inserted by the Writer. OK. > > 2. similarly, the arguments lose the '='. > > "=" are lost for the same reason: redundancy. The back-end Writer may > choose to always use "--option=arg" or always use "--option arg", but it > should be consistent. > > > This becomes ambiguous: > > I don't see the ambiguity. Please explain. I believe it's up to the original source - which knows how the program accepts arguments - to determine whether an '=' is required, not the output writer. Assuming that all programs that accept long arguments must use '=' is dangerous. > > 3. short options can't have '=' arguments: > > > > -DC_DEFINE_FLAG=value > > > > results in an error. > > Correct. Short options never have '=' (not on any system I've seen, > anyhow). Short option names are never more than one letter long, either -- > that's why they're short! Your example is actually equivalent to:: The above is a fairly standard define argument for a C compiler. For example: -DHAVE_CONFIG_H -DPREFIX='"$(prefix)"' Is used all over the place in autoconf-generate Makefiles. In the above, the -D is the option, the rest of the text is the option argument. > > 4. any chance of a format like: > > > > -i / --info get information > > I chose ", " as the separator from observation of the "--help" output of > various tools. I don't see the need for two ways to spell it. Also, "/" is > used for VMS/DOS-style options, so it may be confusing here. OK, and it's documented, so I'm happy. Sorry I didn't notice that in the spec. Richard ps. 90% of the html formatter is done - biblio and some reference stuff still to be done. I'm also going to assume from the terminology above that the formatter should be renamed "HTMLWriter"? |