[Changed option parsing, can now parse negative Int options
martin.hofmann@uni-bamberg.de**20100326124418] hunk ./src/Igor2/UI/UIStarter.hs 36
+import Debug.Trace
+
hunk ./src/Igor2/UI/UIStarter.hs 143
-runCmd s (Set f)                = return (False, f s) 
+runCmd s (SetOpt f)                = return (False, f s) 
hunk ./src/Igor2/UI/UIStarter.hs 318
-resToDoc :: (Pretty a) => Int -> Doc -> Either String ([(Name,Int)],[[[a]]]) -> Doc
+resToDoc :: (Pretty a) => 
+           Int -> Doc -> Either String ([(Name,Int)],[[[a]]]) -> Doc
hunk ./src/Igor2/UI/UIStarter.hs 321
-    outroBanner <$$>
-    (red . text $ "UNCAUGHT ERROR: " ++ msg ++ "\n")
+  outroBanner <$$> (red . text $ "UNCAUGHT ERROR: " ++ msg ++ "\n")
hunk ./src/Igor2/UI/UIStarter.hs 369
- | Set (EnvState -> EnvState)
+ | SetOpt (EnvState -> EnvState)
hunk ./src/Igor2/UI/UIStarter.hs 395
-            "Set options.",                   pSet)
+            "Set options.",                   pSetOpt)
hunk ./src/Igor2/UI/UIStarter.hs 491
-         , reservedOpNames = [":",";","+","-","=", "with", "on"]
-         , identLetter    = alphaNum <|> oneOf "_'.~/" 
-         , identStart     = alphaNum <|> oneOf "_'.~/" 
+         , reservedOpNames = [":",";", "with", "on"]
+         , identLetter    = alphaNum <|> oneOf "-+_'.~/" 
+         , identStart     = alphaNum <|> oneOf "-+_'.~/" 
hunk ./src/Igor2/UI/UIStarter.hs 533
-pSet :: Parser Cmd
-pSet =  do cmds <-  many1 (choice [pFlag, pIntOption, pStrOption])
-           return $ foldl1 compose cmds
+pSetOpt :: Parser Cmd
+pSetOpt =  do cmds <-  many1 (choice [pFlag, pIntOption, pStrOption])
+              return $ foldl1 compose cmds
hunk ./src/Igor2/UI/UIStarter.hs 537
-    compose (Set f) (Set g) = Set (g . f)         
+    compose (SetOpt f) (SetOpt g) = SetOpt (g . f)         
hunk ./src/Igor2/UI/UIStarter.hs 541
-          ; setter <- choice [ do{reserved f; return $ s True} | (f,_,_,s) <- flags]
-          ; return $ Set setter
+          ; setter <- choice [ do{reserved f; return $ s True} 
+                            | (f,_,_,s) <- flags]
+          ; return $ SetOpt setter
hunk ./src/Igor2/UI/UIStarter.hs 546
-           ; setter <- choice [ do{reserved f; return $ s False} | (f,_,_,s) <- flags]
-           ; return $ Set setter
-           }
+          ; setter <- choice [ do{ reserved f; return $ s False} 
+                                    | (f,_,_,s) <- flags ]
+          ; return $ SetOpt setter
+          }
hunk ./src/Igor2/UI/UIStarter.hs 553
-pIntOption = do{ f <- choice [do{reserved o; return s} | (o,_,_,s) <- intOptions]
-            ; reservedOp "="
-            ; i <- integer
-            ; return $ Set (f i)
-            }
-   <?> ":set <option>=<value>"
+pIntOption = do{ f <- choice [ do{reserved o; return s} 
+                            | (o,_,_,s) <- intOptions]
+               ; i <- choice [ reservedOp "=" >> integer
+                            , reservedOp "=-" >> integer >>= return .(*(-1))
+                            , reservedOp "=+" >> integer ]
+               ; return $ SetOpt (f i)
+               } 
+         <?> ":set <option>=<value>"
hunk ./src/Igor2/UI/UIStarter.hs 563
-pStrOption = do{ f <- choice [do{reserved o; return s} | (o,_,_,s) <- strOptions]
-            ; reservedOp "="
-            ; i <- stringLiteral
-            ; return $ Set (f i)
+pStrOption = do{ f <- choice [ do{reserved o; return s} 
+                            | (o,_,_,s) <- strOptions]
+               ; reservedOp "="
+               ; i <- stringLiteral
+               ; return $ SetOpt (f i)