public function getOption($char = '', $name = '', $required = null)
    {
        if (!$char && !$name) {
            return false;
        }
        if ($char && (1 < strlen($char) || 1 !== preg_match('/^\w$/', $char))) {
            return false;
        }
        if ($name && (1 !== preg_match('/^\w+$/', $name))) {
            return false;
        }
        switch ($required) {
            case true:
                $char = $char ? $char.':' : $char;
                $name = $name ? $name.':' : $name;
                break;
            case false:
                $char = $char ? $char.'::' : $char;
                $name = $name ? $name.'::' : $name;
                break;
        }
        $argv = ($opts = getopt($char, [$name])) ? array_shift($opts) : [];
        return is_array($argv) ? array_shift($argv) : $argv;
    }
public function getOption($char = '', $name = '', $required = null)
    {
        if (!$char && !$name) {
            return false;
        }
        if ($char && (1 < strlen($char) || 1 !== preg_match('/^\w$/', $char))) {
            return false;
        }
        if ($name && (1 !== preg_match('/^\w+$/', $name))) {
            return false;
        }
        switch ($required) {
            case true:
                $char = $char ? $char.':' : $char;
                $name = $name ? $name.':' : $name;
                break;
            case false:
                $char = $char ? $char.'::' : $char;
                $name = $name ? $name.'::' : $name;
                break;
        }
        $argv = ($opts = getopt($char, [$name])) ? array_shift($opts) : [];
        return is_array($argv) ? array_shift($argv) : $argv;
    }
public function getOption ( $ char = '' , $ name = '' , $ required = null ) { if ( ! $ char && ! $ name ) { return false ; } if ( $ char && ( 1 < strlen ( $ char ) || 1 !== preg_match ( '/^\w$/' , $ char ) ) ) { return false ; } if ( $ name && ( 1 !== preg_match ( '/^\w+$/' , $ name ) ) ) { return false ; } switch ( $ required ) { case true : $ char = $ char ? $ char . ':' : $ char ; $ name = $ name ? $ name . ':' : $ name ; break ; case false : $ char = $ char ? $ char . '::' : $ char ; $ name = $ name ? $ name . '::' : $ name ; break ; } $ argv = ( $ opts = getopt ( $ char , [ $ name ] ) ) ? array_shift ( $ opts ) : [ ] ; return is_array ( $ argv ) ? array_shift ( $ argv ) : $ argv ; }
Get arguments from command line

@access public

@param string $char -a .. -z option char
@param string $name --optionName_string
@param bool|null $required Required value?

@return mixed
Get arguments from command line