Add quiet option to decrease log level
This commit is contained in:
parent
b9230c7e3f
commit
c05bd816e7
@ -12,6 +12,7 @@ module Language.Haskell.GhcMod (
|
|||||||
-- * Logging
|
-- * Logging
|
||||||
, GmLogLevel
|
, GmLogLevel
|
||||||
, increaseLogLevel
|
, increaseLogLevel
|
||||||
|
, decreaseLogLevel
|
||||||
, gmSetLogLevel
|
, gmSetLogLevel
|
||||||
, gmLog
|
, gmLog
|
||||||
-- * Types
|
-- * Types
|
||||||
|
@ -40,6 +40,10 @@ increaseLogLevel :: GmLogLevel -> GmLogLevel
|
|||||||
increaseLogLevel l | l == maxBound = l
|
increaseLogLevel l | l == maxBound = l
|
||||||
increaseLogLevel l = succ l
|
increaseLogLevel l = succ l
|
||||||
|
|
||||||
|
decreaseLogLevel :: GmLogLevel -> GmLogLevel
|
||||||
|
decreaseLogLevel l | l == minBound = l
|
||||||
|
decreaseLogLevel l = succ l
|
||||||
|
|
||||||
-- |
|
-- |
|
||||||
-- >>> Just GmDebug <= Nothing
|
-- >>> Just GmDebug <= Nothing
|
||||||
-- False
|
-- False
|
||||||
|
@ -263,9 +263,14 @@ reqArg udsc dsc = ReqArg dsc udsc
|
|||||||
globalArgSpec :: [OptDescr (Options -> Options)]
|
globalArgSpec :: [OptDescr (Options -> Options)]
|
||||||
globalArgSpec =
|
globalArgSpec =
|
||||||
[ option "v" ["verbose"] "Can be given multiple times to be increasingly\
|
[ option "v" ["verbose"] "Can be given multiple times to be increasingly\
|
||||||
\more verbose." $
|
\ be more verbose." $
|
||||||
NoArg $ \o -> o { logLevel = increaseLogLevel (logLevel o) }
|
NoArg $ \o -> o { logLevel = increaseLogLevel (logLevel o) }
|
||||||
|
|
||||||
|
, option "q" [] "Can be given multiple times to be increasingly be less\
|
||||||
|
\ verbose." $
|
||||||
|
NoArg $ \o -> o { logLevel = decreaseLogLevel (logLevel o) }
|
||||||
|
|
||||||
|
|
||||||
, option "l" ["tolisp"] "Format output as an S-Expression" $
|
, option "l" ["tolisp"] "Format output as an S-Expression" $
|
||||||
NoArg $ \o -> o { outputStyle = LispStyle }
|
NoArg $ \o -> o { outputStyle = LispStyle }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user