src/CLIParser.php
public function options($start = 1)
    {
        
        // Init index
        $this->optind = (0 == ($start)) ? 1 : (int) $start;
        
        // Loop the arguments until there is no option (-1)
        // At the end of the loop $this->optind points to the first non-option
        // parameter
        do {
            $nextOption = $this->getopt();
            
            // If the option is an option (!== -1) and is valid (not null)
            // set it's value and put it in the options array to return
            if (null !== $nextOption && -1 !== $nextOption) {
                $this->options[$nextOption] = (null !== $this->optarg) ? $this->optarg : true;
            }
            
        } while ($nextOption !== -1);
        
        return $this->options;
    }
public function options($start = 1)
    {
        
        // Init index
        $this->optind = (0 == ($start)) ? 1 : (int) $start;
        
        // Loop the arguments until there is no option (-1)
        // At the end of the loop $this->optind points to the first non-option
        // parameter
        do {
            $nextOption = $this->getopt();
            
            // If the option is an option (!== -1) and is valid (not null)
            // set it's value and put it in the options array to return
            if (null !== $nextOption && -1 !== $nextOption) {
                $this->options[$nextOption] = (null !== $this->optarg) ? $this->optarg : true;
            }
            
        } while ($nextOption !== -1);
        
        return $this->options;
    }
public function options ( $ start = 1 ) { // Init index $ this -> optind = ( 0 == ( $ start ) ) ? 1 : ( int ) $ start ; // Loop the arguments until there is no option (-1) // At the end of the loop $this->optind points to the first non-option // parameter do { $ nextOption = $ this -> getopt ( ) ; // If the option is an option (!== -1) and is valid (not null) // set it's value and put it in the options array to return if ( null !== $ nextOption && - 1 !== $ nextOption ) { $ this -> options [ $ nextOption ] = ( null !== $ this -> optarg ) ? $ this -> optarg : true ; } } while ( $ nextOption !== - 1 ) ; return $ this -> options ; }
Return all the options in an associative array where the key is the option's name

For options that act like switches (eg. -v) the array value is TRUE
($options['v'] => true)

For options that require a parameter (eg. -o filename) the array value is the
parameter value ($options['o'] => "filename")

@param int $start Initial index to start with, in order to allow the syntax
'program command [options] [arguments]'

@return array
Return all the options in an associative array where the key is the option s name