public function parse($panic = false) {
        list($shorts, $longs) = $this->getOptionsSearchStrings();
        $options = getopt($shorts, $longs);
        $Exception = null;
        foreach ($this->parameters as $Option) {
            /** @var $Option Option */
            $short = $Option->getShort();
            $long = $Option->getLong();
            switch (true) {
                case isset($options[$short]) && isset($options[$long]):
                    throw new DuplicateOptionException();
                case isset($options[$short]):
                    $this->setOptionValue($Option, $this->getPreparedValue($options[$short]));
                    break;
                case isset($options[$long]):
                    $this->setOptionValue($Option, $this->getPreparedValue($options[$long]));
                    break;
                case $Option->isRequired():
                    $Exception = new RequiredOptionException($long);
            }
        }

        if ($panic && !is_null($Exception)) {
            throw $Exception;
        }
    }