Pimcore\Tool\Console::getOptions PHP Method

getOptions() public static method

Returns a hash with all options passed to a cli script
public static getOptions ( $onlyFullNotationArgs = false ) : array
return array
    public static function getOptions($onlyFullNotationArgs = false)
    {
        global $argv;
        $options = [];
        $tmpOptions = $argv;
        array_shift($tmpOptions);
        foreach ($tmpOptions as $optionString) {
            if ($onlyFullNotationArgs && substr($optionString, 0, 2) != '--') {
                continue;
            }
            $exploded = explode("=", $optionString, 2);
            $options[str_replace('-', '', $exploded[0])] = $exploded[1];
        }
        return $options;
    }