On Thu, 2005-02-24 at 10:45 +0300, Vladimir Prus wrote:
Hi Julio,
So far, I've added the code to handle -c and -q options. This was very easy to do, given the examples on the web. The only annoyance is that the options are accepted everywhere, but I'd prefer to only accept them if they come before the action name (because the action itself might allow options).
FWIW, I find this CVS like behaviour (where options mean different things depending on where you use them), to be highly confusing and undesirable. If one option mean the same everywhere, it means the interface much simpler.
Somewhat yes. But anyway, I'm not using options in different places with different meanings ;)
after processing the options, so that argv[0] becomes the name of the action, and any remaining entries are its arguments. The same can be achieved with getopt_long.
So... is it there any way to do what I want with the actual implementation? Can't see anything relevant in the docs...
Did you try using positional options to parse the 'action' and arguments to it?
I tried, but I couldn't decipher the documentation. IMVHO, it lacks
some info about what "positional options" are, their purpose, and how
they are intended to be used.
However, if that's the way to go, I'll look at it again.
Thanks,
--
Julio M. Merino Vidal