Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Handsy = FreeT HandsyF IO
- run :: Options -> Handsy a -> IO a
- shell :: String -> CommandOptions -> Handsy (ExitCode, ByteString, ByteString)
- command :: FilePath -> [String] -> CommandOptions -> Handsy (ExitCode, ByteString, ByteString)
- readFile :: FilePath -> Handsy ByteString
- writeFile :: FilePath -> ByteString -> Handsy ()
- appendFile :: FilePath -> ByteString -> Handsy ()
- shell_ :: String -> CommandOptions -> Handsy (ByteString, ByteString)
- command_ :: FilePath -> [String] -> CommandOptions -> Handsy (ByteString, ByteString)
- data CommandOptions = CommandOptions {
- stdin :: ByteString
- cwd :: String
- data Options = Options {}
- data ExitCode :: *
- def :: Default a => a
Documentation
Commands
:: String | String to execute |
-> CommandOptions | |
-> Handsy (ExitCode, ByteString, ByteString) | (ExitCode, Stdout, Stderr) |
Executes the given string in shell. Example:
shell "ls" $~ def{cwd="/var/www"}
:: FilePath | Command to run |
-> [String] | Arguments |
-> CommandOptions | |
-> Handsy (ExitCode, ByteString, ByteString) | (status, stdout, stderr) |
Runs a command
readFile :: FilePath -> Handsy ByteString Source
Reads a file and returns the contents of the file.
writeFile :: FilePath -> ByteString -> Handsy () Source
writeFile file str
function writes the bytestring str
, to the file file
.
appendFile :: FilePath -> ByteString -> Handsy () Source
appendFile file str
function appends the bytestring str
, to the file file
.
Helpers
shell_ :: String -> CommandOptions -> Handsy (ByteString, ByteString) Source
Same as shell
, but ExitFailure is a runtime error.
command_ :: FilePath -> [String] -> CommandOptions -> Handsy (ByteString, ByteString) Source
Same as command
, but ExitFailure is a runtime error.
Options
data CommandOptions Source
CommandOptions | |
|
Re-exports
data ExitCode :: *
Defines the exit codes that a program can return.
ExitSuccess | indicates successful termination; |
ExitFailure Int | indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system). |
Eq ExitCode | |
Ord ExitCode | |
Read ExitCode | |
Show ExitCode | |
Exception ExitCode | |
Monoid ExitCode | A process usually has one |
Typeable * ExitCode | |
ListLikeProcessIO a c => ProcessOutput a (ExitCode, a, a) | |
IsReturnValue (ExitCode, ByteString, ByteString) |