public function addSubcommand($name, array $options = [])
    {
        if ($name instanceof ConsoleInputSubcommand) {
            $command = $name;
            $name = $command->name();
        } else {
            $name = Inflector::underscore($name);
            $defaults = [
                'name' => $name,
                'help' => '',
                'parser' => null
            ];
            $options += $defaults;

            $command = new ConsoleInputSubcommand($options);
        }
        $this->_subcommands[$name] = $command;
        if ($this->_subcommandSort) {
            asort($this->_subcommands);
        }

        return $this;
    }