[fw-general] Zend_Console_Getopt manage if there no options

2011-07-07 Thread whisher
Hi, try { $opts = new Zend_Console_Getopt(array( 'id=i' = 'id option,required an integer parameter' )); $opts-parse(); echo $opts-id; } catch (Zend_Console_Getopt_Exception $e) { echo $e-getMessage(); echo $e-getUsageMessage(); exit(); } If I run this snippet

Re: [fw-general] Zend_Console_Getopt manage if there no options

2011-07-07 Thread Hector Virgen
That's not exactly how the options work. How it works is if the id parameter is passed in then an integer value is required. It won't fail if no id parameter is passed in. You may want to add this code after the catch block to make the id argument required: if (null === $opts-id) { echo