System.Console.CmdArgs.Verbosity

cmdargs-0.10.14: Command line argument processing

Safe Haskell | None
Language | Haskell98

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

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

Bounded Verbosity |
Enum Verbosity |
Eq Verbosity |
Data Verbosity |
Ord Verbosity |
Read Verbosity |
Show Verbosity |

setVerbosity :: Verbosity -> IO ()

Set the global verbosity.

getVerbosity :: IO Verbosity

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

isNormal :: IO Bool

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

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 ()

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

whenLoud :: IO () -> IO ()

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