Unixutils-1.44: A crude interface between Haskell and Unix-like operating systems

System.Unix.OldProgress

Contents

Description

Run shell commands with various types of progress reporting.

Author: David Fox

Synopsis

Documentation

systemTask :: [Style] -> String -> IO TimeDiffSource

Create a task that sends its output to a handle and then can be terminated using an IO operation that returns an exit status. Throws an error if the command fails.

otherTask :: [Style] -> IO a -> IO aSource

data Style Source

Constructors

Start String

Message printed before the execution begins

Finish String

Message printed on successful termination

Error String

Message printed on failure

Output Output

Type of output to generate during execution

Echo Bool

If true, echo the shell command before beginning

Elapsed Bool

If true print the elapsed time on termination

Verbosity Int

Set the verbosity level. This value can be queried using the verbosity function, but is not otherwise used by the -- functions in this module.

Indent String

Set the indentation string for the generated output.

Instances

data Output Source

Constructors

Indented

Print all the command's output with each line indented using (by default) the string ' > '.

Dots

Print a dot for every 1024 characters the command outputs

Done

Print an ellipsis (...) when the command starts and then done. when it finishes.

Quiet

Print nothing.

Instances

Accessors

Style Set modification

setStyles :: [Style] -> [Style] -> [Style]Source

Add styles, replacing old ones if present

setStyle :: Style -> [Style] -> [Style]Source

Singleton case of setStyles

addStyles :: [Style] -> [Style] -> [Style]Source

Add styles only if not present

addStyle :: Style -> [Style] -> [Style]Source

Singleton case of addStyles

removeStyle :: Style -> [Style] -> [Style]Source

Remove styles by class

Utilities

data TimeDiff

records the difference between two clock times in a user-readable way.

noTimeDiff :: TimeDiff

null time difference.

fixedTimeDiffToString :: TimeDiff -> [Char]Source

The timeDiffToString function returns the empty string for the zero time diff, this is not the behavior I need.