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;
    }