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 Source

Terminal display state

Basic

displayInit :: IO TerminalDisplay Source

Create a new display

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

A simple utility that display a msg in color

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

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

Progress Bar

data ProgressBar Source

Progress bar widget

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

Create a new progress bar context

progressTick :: ProgressBar -> IO () Source

Tick an element on the progress bar

Summary line

data Summary Source

Summary

summary :: TerminalDisplay -> IO Summary Source

Create a summary

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

Set the summary

Attributes

data Color :: *

Instances

data OutputElem Source

Element to output text and attributes to the display

justify :: Justify -> Int -> String -> String Source

box a string to a specific size, choosing the justification

Table

data Justify Source

Justify position

Constructors

JustifyLeft 
JustifyRight 

data Table Source

Table widget

data Column Source

Column for a table

columnNew :: Int -> String -> Column Source

Create a new column setting the right default parameters

tableCreate :: [Column] -> Table Source

Create a new table

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

Show the table headers

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

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.