private function addSubCommand(SubCommandConfig $config)
    {
        if (!$config->isEnabled()) {
            return;
        }

        $this->validateSubCommandName($config);

        $command = new self($config, $this->application, $this);

        $this->subCommands->add($command);

        if ($config->isDefault()) {
            $this->defaultSubCommands->add($command);
        }

        if (!$config->isAnonymous()) {
            $this->namedSubCommands->add($command);
        }
    }