public function parse()
    {
        $this->parser->parse($this->rawArguments);
        $this->parsed = true;
        $this->arguments = $this->parser->getArguments();
        $optionsShort = $this->parser->getOptionsShort();
        $optionsLong = $this->parser->getOptionsLong();
        $missongRequired = array();
        foreach ($this->optionDefinitions as $definition) {
            $value = $this->getOptionValue($definition);
            $short = $definition->getShort();
            $long = $definition->getLong();
            $optionsShort[$short] = $value;
            $optionsLong[$long] = $value;
            if ($definition->getRequired() && $value === null) {
                $parts = array();
                $parts[] = $short !== null ? '-' . $short : null;
                $parts[] = $long !== null ? '--' . $long : null;
                $missongRequired[] = implode('|', $parts);
            }
        }
        if (!empty($missongRequired)) {
            throw new GetoptException(
                'Missing required options: '
                . implode(', ', $missongRequired)
            );
        }
        $this->optionsShort = $optionsShort;
        $this->optionsLong = $optionsLong;
    }