Argparse as lib for PHP?

Is there a PHP library that provides similar functionality like the argparse Python module ? PHP getopt , of course, does not shorten it.

What I need:

  • mandatory parameter checking and automatic generation of error messages.
  • Correct exit status on error (> 0 if par parse error).
  • error message in STDERR.
  • help msg generation of all accepted parameters.
  • Checking the type of parameter is a bonus.

Basically, how a * NIX CLI script should behave.

+3
source share
3 answers

You can use Zend_Console_GetOpt .

+1
source

, ( , ), Console_CommandLine. argparse, , .

+2
0
source

All Articles