ZF-8198: Zend Tool does not properly support long options

Description

When creating a Provider, if two parameters start with the same letter, regardless of long options, it will throw an exception.

The expected behavior is that long options should prevail if they are unique.

=C=

Comments

I cant reproduce it with the Incubator code, would a provider action like the following lead to this exception?


    public function test($ac, $ab)
    {

    }

Can you run the command with --debug as a main arg also and paste the trace?

I can confirm this issue as well.

The provider class:


class My_Component_HelloProvider implements Zend_Tool_Framework_Provider_Interface
{
    public function say($ac, $ab)
    {
    }
}

The trace:

{quote} $ ./zf.sh --debug say hello a b

                      An Error Has Occurred

Option "-a" is being defined more than once.

0 /library/Zend/Console/Getopt.php(430): Zend_Console_Getopt->_addRulesModeZend(Array)

1 /library/Zend/Console/Getopt.php(259): Zend_Console_Getopt->addRules(Array)

2 /library/Zend/Tool/Framework/Client/Console/ArgumentParser.php(499): Zend_Console_Getopt->__construct(Array, Array, Array)

3 /library/Zend/Tool/Framework/Client/Console/ArgumentParser.php(210): Zend_Tool_Framework_Client_Console_ArgumentParser->_parseProviderOptionsPart()

4 /library/Zend/Tool/Framework/Client/Console.php(196): Zend_Tool_Framework_Client_Console_ArgumentParser->parse()

5 /library/Zend/Tool/Framework/Client/Abstract.php(227): Zend_Tool_Framework_Client_Console->_preDispatch()

6 /data/bin/zf/zf.php(619): Zend_Tool_Framework_Client_Abstract->dispatch()

7 /data/bin/zf/zf.php(128): ZF->_runTool()

8 /data/bin/zf/zf.php(85): ZF->run()

9 /data/bin/zf/zf.php(643): ZF::main()

10 {main}

Zend Framework Command Line Console Tool v1.11.0dev Details for action "Say" and provider "Hello" Hello zf say hello ac ab {quote}