public function hasFlag($name)
    {
        $option = $this->definition->getOption($name);

        if (!$option->isFlag()) {
            throw new \InvalidArgumentException(sprintf('The "--%s" option is not a flag.', $name));
        }

        return !empty($this->options[$name]);
    }