Class jCmdUtils

Description

utilities functions for command line

Located in /utils/jCmdUtils.class.php (line 18)


	
			
Method Summary
static array getOptionsAndParams (array $argv, array $sws, array $params)
Methods
static getOptionsAndParams (line 49)

analyze command line parameters and return an array of all options and parameters which correspond to allowed options and parameters

allowed options should be an array like this : array('-option1'=>bool, '-option2'=>bool, ..) the boolean indicates that the option has a parameter on the CLI

allowed parameters is an array like this: array('param1'=>bool, 'param2'=>bool, ..) it means that the first parameter value will be in the param1, the second in param2 etc.. The boolean says that the parameter is optional. If a parameter is optional, following parameters should be optional.

the returned array contains two array : array('-option1'=>value, '-option2'=>value, ...) array('param1'=>value, 'param2'=>value...)

  • return: an array with the array of founded option and an array with founded parameters
  • access: public
static array getOptionsAndParams (array $argv, array $sws, array $params)
  • array $argv: the array of parameters given by php-cli
  • array $sws: allowed options
  • array $params: allowed parameters

Documentation generated on Wed, 04 Jan 2017 22:52:30 +0100 by phpDocumentor 1.4.3