[Fiddle with analyse flags Roman Leshchinskiy **20091124151632 Ignore-this: afc9f54427780b9c7f721ac75d8fe640 ] hunk ./Analyse.hs 13 - (file : args) <- getArgs - bs <- readLog file - table <- foldM procArg (mkTable secs bs) args - putStrLn "" - putStrLn $ htmlTable table - putStrLn "" + (arg : args) <- getArgs + if arg == "--diff" + then doDiff args + else doTable arg args + +doTable file args + = do + bs <- readLog file + table <- foldM procArg (mkTable secs bs) args + outputHTML table + +doDiff (file1 : file2 : args) + = do + bs1 <- readLog file1 + bs2 <- readLog file2 + let t = intersectTable ratio cmp (mkTable secs bs1) (mkTable secs bs2) + table <- foldM procArg t args + outputHTML table + where + ratio d = printf "%.3f" d + + cmp d1 d2 = d1 / d2 + + +outputHTML :: Table -> IO () +outputHTML t + = do + putStrLn "" + putStrLn $ htmlTable t + putStrLn "" hunk ./Analyse.hs 54 - | Just file <- dropPrefix "--compare=" arg - = do - bs <- readLog file - return $ intersectTable ratio cmp t (mkTable secs bs) - - where - ratio d = printf "%.3f" d - - cmp d1 d2 = d1 / d2 -