public function registerOption($long, $help, $short = null, $needsarg = false, $command = '')
    {
        if (!isset($this->setup[$command])) {
            throw new Exception("Command $command not registered");
        }

        $this->setup[$command]['opts'][$long] = array(
            'needsarg' => $needsarg,
            'help' => $help,
            'short' => $short
        );

        if ($short) {
            if (strlen($short) > 1) {
                throw new Exception("Short options should be exactly one ASCII character");
            }

            $this->setup[$command]['short'][$short] = $long;
        }
    }