diff -bBupNr getopt_1.14/R/getopt.R getopt/R/getopt.R
--- getopt_1.14/R/getopt.R	2008-04-30 18:13:47.000000000 +0900
+++ getopt/R/getopt.R	2010-04-28 16:30:00.000000000 +0900
@@ -236,9 +236,20 @@ getopt = function (spec=NULL,opt=command
         peek.optstring = opt[i + 1];
         if ( debug ) print(paste('      peeking ahead at: "',peek.optstring,'"',sep=''));
 
-        #got an argument.  attach it, increment the index, and move on to the next option.  we don't allow arguments beginning with '-'.
-        if ( substr(peek.optstring, 1, 1) != '-' ) {
-          if ( debug ) print('        consuming argument');
+        #got an argument.  attach it, increment the index, and move on to the next option.  we don't allow arguments beginning with '-' UNLESS
+        if ( substr(peek.optstring, 1, 1) != '-' |
+	  #match negative double
+	  ( substr(peek.optstring, 1, 1) == '-'
+	  & regexpr('^-[0123456789]*\\.?[0123456789]+$',peek.optstring) > 0
+	  & spec[rowmatch, col.mode]== 'double'
+	  ) |
+	  #match negative integer
+	  ( substr(peek.optstring, 1, 1) == '-'
+	  & regexpr('^-[0123456789]+$',peek.optstring) > 0
+	  & spec[rowmatch, col.mode]== 'integer'
+	  )
+	) {
+          if ( debug ) print(paste('        consuming argument *',peek.optstring,'*',sep=''));
 
           storage.mode(peek.optstring) = spec[current.flag, col.mode];
           result[spec[current.flag, col.long.name]] = peek.optstring;
