cli-0.1.2: Command Line Interface

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
PortabilityGood
Safe HaskellSafe
LanguageHaskell2010

Console.Display

Contents

Description

Displaying utilities

Synopsis

Documentation

data TerminalDisplay #

Terminal display state

Basic

displayInit :: IO TerminalDisplay #

Create a new display

display :: TerminalDisplay -> [OutputElem] -> IO () #

Display

displayTextColor :: TerminalDisplay -> Color -> String -> IO () #

A simple utility that display a msg in color

displayLn :: TerminalDisplay -> Color -> String -> IO () #

A simple utility that display a msg in color and newline at the end.

Progress Bar

data ProgressBar #

Progress bar widget

progress :: TerminalDisplay -> Int -> (ProgressBar -> IO a) -> IO a #

Create a new progress bar context

progressTick :: ProgressBar -> IO () #

Tick an element on the progress bar

Summary line

data Summary #

Summary

summary :: TerminalDisplay -> IO Summary #

Create a summary

summarySet :: Summary -> [OutputElem] -> IO () #

Set the summary

Attributes

data Color :: * #

Instances

Eq Color 

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

Ord Color 

Methods

compare :: Color -> Color -> Ordering #

(<) :: Color -> Color -> Bool #

(<=) :: Color -> Color -> Bool #

(>) :: Color -> Color -> Bool #

(>=) :: Color -> Color -> Bool #

max :: Color -> Color -> Color #

min :: Color -> Color -> Color #

Show Color 

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

data OutputElem #

Element to output text and attributes to the display

justify :: Justify -> Int -> String -> String #

box a string to a specific size, choosing the justification

Table

data Justify #

Justify position

Constructors

JustifyLeft 
JustifyRight 

data Table #

Table widget

data Column #

Column for a table

columnNew :: Int -> String -> Column #

Create a new column setting the right default parameters

tableCreate :: [Column] -> Table #

Create a new table

tableHeaders :: TerminalDisplay -> Table -> IO () #

Show the table headers

tableAppend :: TerminalDisplay -> Table -> [String] -> IO () #

Append a row to the table.

if the number of elements is greater than the amount of column the table has been configured with, the extra elements are dropped.