debian-3.23: Modules for working with the Debian package systemSource codeContentsIndex
Debian.Shell
Contents
Semi-obsolete
Type Class
Description
This module probably belongs in haskell-unixutils.
Synopsis
echoCommand :: CIO m => String -> ByteString -> m [Output]
echoProcess :: CIO m => FilePath -> [String] -> ByteString -> m [Output]
dotOutput :: CIO m => Int -> [Output] -> m [Output]
vOutput :: CIO m => Int -> [Output] -> m [Output]
runCommand :: CIO m => Int -> String -> m (Either String [Output])
runCommandQuietly :: CIO m => String -> m (Either String [Output])
runCommandTimed :: CIO m => Int -> String -> m (Either String ([Output], TimeDiff))
runCommandQuietlyTimed :: CIO m => String -> m (Either String ([Output], TimeDiff))
runCommandMsg :: CIO m => Int -> Maybe String -> String -> (Int -> m (Either String ())) -> m (Either String ())
class ShellTask a where
command :: a -> Either String (FilePath, [String], Maybe FilePath, Maybe [(String, String)])
input :: a -> ByteString
quietness :: a -> Int
introMsg :: a -> Maybe String
failMsg :: a -> Maybe (Int -> String)
finishMsg :: a -> Maybe String
data SimpleTask = SimpleTask Int String
data FullTask = FullTask {
taskQuietness :: Int
taskCommand :: Either String (FilePath, [String], Maybe FilePath, Maybe [(String, String)])
taskIntroMsg :: Maybe String
taskFailMsg :: Maybe (Int -> String)
taskFinishMsg :: Maybe String
}
commandTask
processTask
showCommand
setStart :: Maybe String -> FullTask -> FullTask
setFinish :: Maybe String -> FullTask -> FullTask
setError :: Maybe (Int -> String) -> FullTask -> FullTask
runTask :: (ShellTask a, CIO m) => a -> m [Output]
runTaskAndTest :: (ShellTask a, CIO m) => a -> m (Either String [Output])
timeTask :: MonadIO m => m a -> m (a, TimeDiff)
timeTaskAndTest :: (ShellTask a, CIO m) => a -> m (Either String ([Output], TimeDiff))
timeCommand :: CIO m => m (Either String [Output]) -> m (Either String ([Output], TimeDiff))
showElapsed :: CIO m => String -> m a -> m a
myTimeDiffToString
Documentation
echoCommand :: CIO m => String -> ByteString -> m [Output]Source
echoProcess :: CIO m => FilePath -> [String] -> ByteString -> m [Output]Source
Echo the process arguments and then run the process
dotOutput :: CIO m => Int -> [Output] -> m [Output]Source
Print one dot to stderr for every COUNT characters of output.
vOutput :: CIO m => Int -> [Output] -> m [Output]Source
Semi-obsolete
runCommand :: CIO m => Int -> String -> m (Either String [Output])Source
runCommandQuietly :: CIO m => String -> m (Either String [Output])Source
runCommandTimed :: CIO m => Int -> String -> m (Either String ([Output], TimeDiff))Source
runCommandQuietlyTimed :: CIO m => String -> m (Either String ([Output], TimeDiff))Source
runCommandMsg :: CIO m => Int -> Maybe String -> String -> (Int -> m (Either String ())) -> m (Either String ())Source
Type Class
class ShellTask a whereSource
Not sure if this is a useful approach.
Methods
command :: a -> Either String (FilePath, [String], Maybe FilePath, Maybe [(String, String)])Source
input :: a -> ByteStringSource
quietness :: a -> IntSource
introMsg :: a -> Maybe StringSource
failMsg :: a -> Maybe (Int -> String)Source
finishMsg :: a -> Maybe StringSource
show/hide Instances
data SimpleTask Source
Constructors
SimpleTask Int String
show/hide Instances
data FullTask Source
Constructors
FullTask
taskQuietness :: Int
taskCommand :: Either String (FilePath, [String], Maybe FilePath, Maybe [(String, String)])
taskIntroMsg :: Maybe String
taskFailMsg :: Maybe (Int -> String)
taskFinishMsg :: Maybe String
show/hide Instances
commandTask
processTask
showCommand
setStart :: Maybe String -> FullTask -> FullTaskSource
setFinish :: Maybe String -> FullTask -> FullTaskSource
setError :: Maybe (Int -> String) -> FullTask -> FullTaskSource
runTask :: (ShellTask a, CIO m) => a -> m [Output]Source
runTaskAndTest :: (ShellTask a, CIO m) => a -> m (Either String [Output])Source
timeTask :: MonadIO m => m a -> m (a, TimeDiff)Source
Run a task and return the elapsed time along with its result.
timeTaskAndTest :: (ShellTask a, CIO m) => a -> m (Either String ([Output], TimeDiff))Source
timeCommand :: CIO m => m (Either String [Output]) -> m (Either String ([Output], TimeDiff))Source
Run a command and return its result along with the amount of time it took.
showElapsed :: CIO m => String -> m a -> m aSource
Perform a task, print the elapsed time it took, and return the result.
myTimeDiffToString
Produced by Haddock version 2.4.2