cmdargs-0.10.22: Command line argument processing

Safe Haskell | Safe-Inferred
Language | Haskell2010

System.Console.CmdArgs.Verbosity

Description

A module to deal with verbosity, how 'chatty' a program should be. This module defines the `Verbosity` data type, along with functions for manipulating a global verbosity value.

Synopsis

- data Verbosity
  - = Quiet
  - | Normal
  - | Loud
- setVerbosity :: Verbosity -> IO ()
- getVerbosity :: IO Verbosity
- isNormal :: IO Bool
- isLoud :: IO Bool
- whenNormal :: IO () -> IO ()
- whenLoud :: IO () -> IO ()

# Documentation

data Verbosity Source #

The verbosity data type

Constructors

Quiet | Only output essential messages (typically errors)
Normal | Output normal messages (typically errors and warnings)
Loud | Output lots of messages (typically errors, warnings and status updates)

#### Instances

Instances details

Data Verbosity Source # |

Instance details

Defined in System.Console.CmdArgs.Verbosity

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Verbosity -> c Verbosity Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Verbosity Source #

toConstr :: Verbosity -> Constr Source #

dataTypeOf :: Verbosity -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Verbosity) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Verbosity) Source #

gmapT :: (forall b. Data b => b -> b) -> Verbosity -> Verbosity Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Verbosity -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Verbosity -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Verbosity -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Verbosity -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity Source #

Bounded Verbosity Source # |
Instance details Defined in System.Console.CmdArgs.Verbosity Methods minBound :: Verbosity Source # maxBound :: Verbosity Source #
Enum Verbosity Source # |

Instance details

Defined in System.Console.CmdArgs.Verbosity

Methods

succ :: Verbosity -> Verbosity Source #

pred :: Verbosity -> Verbosity Source #

toEnum :: Int -> Verbosity Source #

fromEnum :: Verbosity -> Int Source #

enumFrom :: Verbosity -> [Verbosity] Source #

enumFromThen :: Verbosity -> Verbosity -> [Verbosity] Source #

enumFromTo :: Verbosity -> Verbosity -> [Verbosity] Source #

enumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity] Source #

Read Verbosity Source # |
Instance details Defined in System.Console.CmdArgs.Verbosity Methods readsPrec :: Int -> ReadS Verbosity Source # readList :: ReadS [Verbosity] Source # readPrec :: ReadPrec Verbosity Source # readListPrec :: ReadPrec [Verbosity] Source #
Show Verbosity Source # |
Instance details Defined in System.Console.CmdArgs.Verbosity Methods showsPrec :: Int -> Verbosity -> ShowS Source # show :: Verbosity -> String Source # showList :: [Verbosity] -> ShowS Source #
Eq Verbosity Source # |
Instance details Defined in System.Console.CmdArgs.Verbosity Methods (==) :: Verbosity -> Verbosity -> Bool Source # (/=) :: Verbosity -> Verbosity -> Bool Source #
Ord Verbosity Source # |

Instance details

Defined in System.Console.CmdArgs.Verbosity

Methods

compare :: Verbosity -> Verbosity -> Ordering Source #

(<) :: Verbosity -> Verbosity -> Bool Source #

(<=) :: Verbosity -> Verbosity -> Bool Source #

(>) :: Verbosity -> Verbosity -> Bool Source #

(>=) :: Verbosity -> Verbosity -> Bool Source #

max :: Verbosity -> Verbosity -> Verbosity Source #

min :: Verbosity -> Verbosity -> Verbosity Source #

setVerbosity :: Verbosity -> IO () Source #

Set the global verbosity.

getVerbosity :: IO Verbosity Source #

Get the global verbosity. Initially `Normal` before any calls to `setVerbosity`.

isNormal :: IO Bool Source #

Used to test if warnings should be output to the user. `True` if the verbosity is set to `Normal` or `Loud` (when `--quiet` is not specified).

isLoud :: IO Bool Source #

Used to test if status updates should be output to the user. `True` if the verbosity is set to `Loud` (when `--verbose` is specified).

whenNormal :: IO () -> IO () Source #

An action to perform if the verbosity is normal or higher, based on `isNormal`.

whenLoud :: IO () -> IO () Source #

An action to perform if the verbosity is loud, based on `isLoud`.