Re: Re: Console_Getopt and 'ambiguous' options

From: Date: Fri, 04 Nov 2005 17:28:18 +0000
Subject: Re: Re: Console_Getopt and 'ambiguous' options
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21796@lists.php.net to get a copy of this message
Bonsoir, Jocke Selin wrote:
On 11/4/05, Greg Beaver <cellog@php.net> wrote:
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. What's the reson for this (shortcoming)? (AFAIK this limits the options to 26 [english])
     
don't forget digits ;)
My bad! ;)
Seriously though, perhaps your project might benefit from the use of another model, such as the command pattern used by PEAR itself. The reason short options must be a single character is because it is possible to do: command -asdfieo This works exactly like: command -a -s -d -f -i -e -o
Fair point Greg, however most of our options must have a value, and using the long options makes the command line almost english, so we'd like to stick with the long options. :) Thanks! /Jocke Perhaps I don't get it right,
but the long options are designed in such a way that you only need an anambiguous start to specify them. Say , if you defined --option, then input --opt could be enough to get it. But then, the input must be sufficient to differentiate it. Say you defined --opt1 and --opt2 then, you get this error message if input is done using --opt because then --opt is ambiguous as cannot assert if it's --opt1 or --opt2. (input --o or --op would be ambiguous the same) That's the onliest case where this message is issued, and you *may* use long options starting with the same letters. Sorry for my crap english. a+ -- bertrand "toggg" Gugger

« previous php.pear.general (#21796) next »