Re: Console::GetOpts

From: Date: Fri, 22 Jun 2001 19:03:12 +0000
Subject: Re: Console::GetOpts
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-486@lists.php.net to get a copy of this message
I don't see this with latest CVS. You shouldn't array_shift() the argument array before passing it to getopt but it works anyway. On Fri, 22 Jun 2001, Colin Viebrock wrote: > Take the following code: > > array_shift($argv); > $opts = Console_Getopt::getopt( $argv, 'd:hp:x', array('help') ); > print_r($opts); > > Now, if I run my script as: > > scriptname --help > > This is what I get: > > Array > ( > [0] => Array > ( > [0] => Array > ( > [0] => -- > [1] => > ) > ) > [1] => Array > ( > ) > ) > > I'm thinking that $opts[0][0][0] should be '--help' not '--', right? > > I'm using the version of Console::GetOpt included in 4.0.6RC4 > (// $Id: Getopt.php,v 1.2 2001/03/12 03:05:04 andrei Exp $) > > -- > Colin Viebrock > Co-Founder, easyDNS Technologies Inc. > http://www.easyDNS.com/ > > > -Andrei Documentation is worth it just to be able to answer all your mail with 'RTFM'. -- Alan Cox

« previous php.pear.dev (#486) next »