Commit b774e696 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix giving an error if we are given conflicting mode flags

parent c24bd1bb
...@@ -397,10 +397,10 @@ mode_flags = ...@@ -397,10 +397,10 @@ mode_flags =
setMode :: CmdLineMode -> String -> ModeM () setMode :: CmdLineMode -> String -> ModeM ()
setMode m flag = do setMode m flag = do
(old_mode, old_flag, flags) <- getCmdLineState (old_mode, old_flag, flags) <- getCmdLineState
when (notNull old_flag && flag /= old_flag) $ if notNull old_flag && flag /= old_flag
throwDyn (UsageError then throwDyn (UsageError
("cannot use `" ++ old_flag ++ "' with `" ++ flag ++ "'")) ("cannot use `" ++ old_flag ++ "' with `" ++ flag ++ "'"))
putCmdLineState (m, flag, flags) else putCmdLineState (m, flag, flags)
addFlag :: String -> ModeM () addFlag :: String -> ModeM ()
addFlag s = do addFlag s = do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment