Commit 2b80dae3 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix more warnings

parent 204a4f5d
......@@ -4,7 +4,13 @@
-- (c) Simon Marlow 2005
-----------------------------------------------------------------------------
module CmdLine where
module CmdLine
(
flags, other_args, cmdline_errors,
devs, nodevs, tooquick_threshold, reportTitle,
CLIFlags(..), usage,
)
where
import System.Console.GetOpt
import System.Environment ( getArgs )
......@@ -43,6 +49,12 @@ data CLIFlags
| OptHelp
deriving Eq
usageHeader :: String
usageHeader = "usage: nofib-analyse [OPTION...] <logfile1> <logfile2> ..."
usage :: String
usage = usageInfo usageHeader argInfo
argInfo :: [ OptDescr CLIFlags ]
argInfo =
[ Option ['?'] ["help"] (NoArg OptHelp)
......
......@@ -15,7 +15,6 @@ import Text.Html hiding (cols, rows, (!))
import qualified Text.Html as Html ((!))
import qualified Data.Map as Map
import Data.Map (Map)
import System.Console.GetOpt
import System.Exit ( exitWith, ExitCode(..) )
import Control.Monad
......@@ -32,14 +31,11 @@ import Data.List
die :: String -> IO a
die s = hPutStr stderr s >> exitWith (ExitFailure 1)
usageHeader :: String
usageHeader = "usage: nofib-analyse [OPTION...] <logfile1> <logfile2> ..."
main :: IO ()
main = do
when (not (null cmdline_errors) || OptHelp `elem` flags) $
die (concat cmdline_errors ++ usageInfo usageHeader argInfo)
die (concat cmdline_errors ++ usage)
let { html = OptHTMLOutput `elem` flags;
latex = OptLaTeXOutput `elem` flags;
......
Markdown is supported
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