public static function buildFromArray($spec, $defaultOptions = true)
    {
        $parser = new static($spec['command'], $defaultOptions);
        if (!empty($spec['arguments'])) {
            $parser->addArguments($spec['arguments']);
        }
        if (!empty($spec['options'])) {
            $parser->addOptions($spec['options']);
        }
        if (!empty($spec['subcommands'])) {
            $parser->addSubcommands($spec['subcommands']);
        }
        if (!empty($spec['description'])) {
            $parser->setDescription($spec['description']);
        }
        if (!empty($spec['epilog'])) {
            $parser->setEpilog($spec['epilog']);
        }

        return $parser;
    }