Unixutils-1.22: A crude interface between Haskell and Unix-like operating systemsSource codeContentsIndex
System.Unix.Progress
Contents
Accessors
Style Set modification
Utilities
Description

Run shell commands with various types of progress reporting.

Author: David Fox

Synopsis
systemTask :: [Style] -> String -> IO TimeDiff
otherTask :: [Style] -> IO a -> IO a
data Style
= Start String
| Finish String
| Error String
| Output Output
| Echo Bool
| Elapsed Bool
| Verbosity Int
| Indent String
readStyle :: String -> Maybe Style
data Output
= Indented
| Dots
| Done
| Quiet
msg :: [Style] -> String -> IO ()
msgLn :: [Style] -> String -> IO ()
output :: [Style] -> Maybe Output
verbosity :: [Style] -> Int
setStyles :: [Style] -> [Style] -> [Style]
setStyle :: Style -> [Style] -> [Style]
addStyles :: [Style] -> [Style] -> [Style]
addStyle :: Style -> [Style] -> [Style]
removeStyle :: Style -> [Style] -> [Style]
stripDist :: FilePath -> FilePath
showElapsed :: String -> IO a -> IO a
data TimeDiff
noTimeDiff :: TimeDiff
fixedTimeDiffToString :: TimeDiff -> [Char]
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 StringMessage printed before the execution begins
Finish StringMessage printed on successful termination
Error StringMessage printed on failure
Output OutputType of output to generate during execution
Echo BoolIf true, echo the shell command before beginning
Elapsed BoolIf true print the elapsed time on termination
Verbosity IntSet the verbosity level. This value can be queried using the verbosity function, but is not otherwise used by the -- functions in this module.
Indent StringSet the indentation string for the generated output.
readStyle :: String -> Maybe StyleSource
data Output Source
Constructors
IndentedPrint all the command's output with each line indented using (by default) the string ' > '.
DotsPrint a dot for every 1024 characters the command outputs
DonePrint an ellipsis (...) when the command starts and then done. when it finishes.
QuietPrint nothing.
msg :: [Style] -> String -> IO ()Source
msgLn :: [Style] -> String -> IO ()Source
Accessors
output :: [Style] -> Maybe OutputSource
verbosity :: [Style] -> IntSource
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
stripDist :: FilePath -> FilePathSource
showElapsed :: String -> IO a -> IO aSource
data TimeDiff Source
records the difference between two clock times in a user-readable way.
noTimeDiff :: TimeDiffSource
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.
Produced by Haddock version 2.6.0