Run shell commands with various types of progress reporting.
Author: David Fox
- systemTask :: [Style] -> String -> IO TimeDiff
- otherTask :: [Style] -> IO a -> IO a
- data Style
- readStyle :: String -> Maybe Style
- data Output
- 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.
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. |
Accessors
Style Set modification
removeStyle :: Style -> [Style] -> [Style]Source
Remove styles by class
Utilities
showElapsed :: String -> IO a -> IO aSource
data TimeDiff
records the difference between two clock times in a user-readable way.
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.