Skip to content

Commit

Permalink
separate docopts debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Oct 21, 2016
1 parent a983142 commit a5dca89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/QuickBench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ defaultFile :: FilePath
defaultFile = "bench.sh"

data Opts = Opts {
docopts :: Arguments,
file :: Maybe FilePath
,executables :: [String]
,iterations :: Int
Expand Down Expand Up @@ -91,7 +90,6 @@ getOpts = do
precision' <- readint $ fromJust $ option "precision"
let
opts = Opts {
docopts = dopts,
file = option "file"
,executables = maybe [] (splitOn ",") $ option "with"
,iterations = iterations'
Expand All @@ -103,7 +101,8 @@ getOpts = do
,help = flag "help"
,clicmds = args
}
when (debug opts || "--debug" `elem` lateflags) $ err $ ppShow opts ++ "\n"
when (debug opts || "--debug" `elem` lateflags) $ do
err $ "docopts: " ++ ppShow dopts ++ "\n" ++ ppShow opts ++ "\n"
when (help opts) $ putStrLn (usage docoptpatterns) >> exitSuccess
-- try to report some errors docopts misses
case (lateflags, args) of
Expand Down

0 comments on commit a5dca89

Please sign in to comment.