parsing - Is there a complete command-line parser for PHP? -


i looking command parsing library similar thor, php.

more specifically, can...

  • handle subcommands input, e.g. git remote add <url>
  • associate options values, e.g. my-command --some-option='value' creates key-value pair array( 'some-option' => 'value' )
  • generates usage/help info configuration passed it
  • processes -short , --long options
  • the library being maintained
  • has in php (otherwise, i'd use thor)

none of solutions have looked @ far has been satisfactory.

the closest thing hitting mark pear's console_getargs, though not being maintained.

the pear command uses console_getopt, though perform significant amount of manual processing achieve features in first 3 requirements.

php's getopt() cannot handle subcommands, , there not seem other built-in methods approximate functionality.

is there php library fits these criteria may have missed?

you try zend_console_getopt or console component of symfony 2


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -