/**
  * @access private
  *
  */
 static function _parseShortOption($arg, $short_options, &$opts, &$args)
 {
     for ($i = 0; $i < strlen($arg); $i++) {
         $opt = $arg[$i];
         $opt_arg = null;
         /* Try to find the short option in the specifier string. */
         if (($spec = strstr($short_options, $opt)) === false || $arg[$i] == ':') {
             throw new Exception("unrecognized option -- {$opt}");
         }
         if (strlen($spec) > 1 && $spec[1] == ':') {
             if (strlen($spec) > 2 && $spec[2] == ':') {
                 if ($i + 1 < strlen($arg)) {
                     /* Option takes an optional argument. Use the remainder of
                        the arg string if there is anything left. */
                     $opts[] = array($opt, substr($arg, $i + 1));
                     break;
                 }
             } else {
                 /* Option requires an argument. Use the remainder of the arg
                    string if there is anything left. */
                 if ($i + 1 < strlen($arg)) {
                     $opts[] = array($opt, substr($arg, $i + 1));
                     break;
                 } else {
                     if (list(, $opt_arg) = each($args)) {
                         /* Else use the next argument. */
                         if (lmbTestGetopt::_isShortOpt($opt_arg) || lmbTestGetopt::_isLongOpt($opt_arg)) {
                             throw new Exception("option requires an argument -- {$opt}");
                         }
                     } else {
                         throw new Exception("option requires an argument -- {$opt}");
                     }
                 }
             }
         }
         $opts[] = array($opt, $opt_arg);
     }
 }