Console_Getopt and 'ambiguous' options
| From: | Jocke Selin | Date: | Fri, 04 Nov 2005 14:45:23 +0000 |
| Subject: | Console_Getopt and 'ambiguous' options | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21774@lists.php.net to get a copy of this message | ||
Gents, and probably directly Andrei,
We've been using Console_Getopts to quite a big success - it's very
nice to use a package like this and not have to worry about decoding
the user input, but instead be able to focus on the real development
work.
Recently we extended the functionality of one of our scripts, and we
started getting these error messages about being ambiguous:
Error: Console_Getopt: option --type is ambiguous.
After a bit of head scratching I notice that this is actually expected
behaviour in the manual.
http://pear.php.net/manual/en/package.console.console-getopt.getopt.php
---
Error code Error message Reason Solution
NULL "Console_Getopt: option --$opt is ambiguous" Two or more long
options starts with the same character. Change the naming of the
options. It is also possible that the error is caused by a typing
mistake.
---
What's the reson for this (shortcoming)? (AFAIK this limits the
options to 26 [english])
We (exclusively) use the long options to promote legibility and
prevent cryptic 'programmer-centric' command line options.
Wouldn't it be possible to separate the long options on
Name: start with "--" ends with "="
Value: after "=" till " " (space). - or if first character after "="
is "'" or """ then till the ending "'" or
""".
This would allow "any number" of options and more importantly options
with any names to be used.
Thanks!
/Jocke