public function options($commandName, $subCommandName = '')
    {
        $Shell = $this->getShell($commandName);

        if (!$Shell) {
            return [];
        }

        $parser = $Shell->getOptionParser();

        if (!empty($subCommandName)) {
            $subCommandName = Inflector::camelize($subCommandName);
            if ($Shell->hasTask($subCommandName)) {
                $parser = $Shell->{$subCommandName}->getOptionParser();
            } else {
                return [];
            }
        }

        $options = [];
        $array = $parser->options();
        /* @var \Cake\Console\ConsoleInputOption $obj */
        foreach ($array as $name => $obj) {
            $options[] = "--$name";
            $short = $obj->short();
            if ($short) {
                $options[] = "-$short";
            }
        }

        return $options;
    }
public function options($commandName, $subCommandName = '')
    {
        $Shell = $this->getShell($commandName);

        if (!$Shell) {
            return [];
        }

        $parser = $Shell->getOptionParser();

        if (!empty($subCommandName)) {
            $subCommandName = Inflector::camelize($subCommandName);
            if ($Shell->hasTask($subCommandName)) {
                $parser = $Shell->{$subCommandName}->getOptionParser();
            } else {
                return [];
            }
        }

        $options = [];
        $array = $parser->options();
        /* @var \Cake\Console\ConsoleInputOption $obj */
        foreach ($array as $name => $obj) {
            $options[] = "--$name";
            $short = $obj->short();
            if ($short) {
                $options[] = "-$short";
            }
        }

        return $options;
    }
public function options ( $ commandName , $ subCommandName = '' ) { $ Shell = $ this -> getShell ( $ commandName ) ; if ( ! $ Shell ) { return [ ] ; } $ parser = $ Shell -> getOptionParser ( ) ; if ( ! empty ( $ subCommandName ) ) { $ subCommandName = Inflector :: camelize ( $ subCommandName ) ; if ( $ Shell -> hasTask ( $ subCommandName ) ) { $ parser = $ Shell -> { $ subCommandName } -> getOptionParser ( ) ; } else { return [ ] ; } } $ options = [ ] ; $ array = $ parser -> options ( ) ; /* @var \Cake\Console\ConsoleInputOption $obj */ foreach ( $ array as $ name => $ obj ) { $ options [ ] = "--$name" ; $ short = $ obj -> short ( ) ; if ( $ short ) { $ options [ ] = "-$short" ; } } return $ options ; }
Get options list for the given command or subcommand

@param string $commandName The command to get options for.
@param string $subCommandName The subcommand to get options for. Can be empty to get options for the command.
If this parameter is used, the subcommand must be a valid subcommand of the command passed
@return array Options list for the given command or subcommand
Get options list for the given command or subcommand