| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Procex.Quick
Synopsis
- (<!|) :: QuickCmd a => Cmd -> Cmd -> a
- (<<<) :: (QuickCmd a, ToByteString b) => Cmd -> b -> a
- (<|) :: QuickCmd a => Cmd -> Cmd -> a
- (|!>) :: QuickCmd a => Cmd -> Cmd -> a
- (|>) :: QuickCmd a => Cmd -> Cmd -> a
- capture :: Cmd -> IO ByteString
- captureNoThrow :: Cmd -> IO ByteString
- captureLazy :: Cmd -> IO ByteString
- captureLazyNoThrow :: Cmd -> IO ByteString
- captureErr :: Cmd -> IO ByteString
- captureErrNoThrow :: Cmd -> IO ByteString
- captureErrLazy :: Cmd -> IO ByteString
- captureErrLazyNoThrow :: Cmd -> IO ByteString
- captureFd :: Fd -> Cmd -> IO (Async ProcessStatus, Handle)
- captureFdLazy :: Fd -> Cmd -> IO ByteString
- captureFdLazyNoThrow :: Fd -> Cmd -> IO ByteString
- pipeArgStrIn :: ToByteString b => b -> Cmd -> Cmd
- mq :: (QuickCmd a, ToByteString b) => b -> a
- quickCmd :: QuickCmd a => Cmd -> a
- class QuickCmd a
- quickCmdArg :: QuickCmdArg a => a -> Cmd -> Cmd
- class QuickCmdArg a
- toByteString :: ToByteString a => a -> ByteString
- class ToByteString a
Documentation
(<!|) :: QuickCmd a => Cmd -> Cmd -> a infixl 1 Source #
Pipe from the right command's stderr to the left command. Returns the left command modified.
(<|) :: QuickCmd a => Cmd -> Cmd -> a infixl 1 Source #
Pipe from the right command to the left command. Returns the left command modified.
(|!>) :: QuickCmd a => Cmd -> Cmd -> a infixl 1 Source #
Pipe from the left command's stderr to the right command. Returns the left command modified.
(|>) :: QuickCmd a => Cmd -> Cmd -> a infixl 1 Source #
Pipe from the left command to the right command. Returns the left command modified.
capture :: Cmd -> IO ByteString Source #
Capture the stdout of the command strictly, err if the command exits with a non-zero exit code.
captureNoThrow :: Cmd -> IO ByteString Source #
Capture the stdout of the command strictly. Ignores process exit code.
captureLazy :: Cmd -> IO ByteString Source #
Capture the stdout of the command lazily.
If the process exits with a non-zero exit code,
reading from the bytestring will throw CmdException.
captureLazyNoThrow :: Cmd -> IO ByteString Source #
Capture the stdout of the command lazily. Ignores process exit code.
captureErr :: Cmd -> IO ByteString Source #
Capture the stderr of the command strictly, err if the command exits with a non-zero exit code.
captureErrNoThrow :: Cmd -> IO ByteString Source #
Capture the stderr of the command strictly. Ignores process exit code.
captureErrLazy :: Cmd -> IO ByteString Source #
Capture the stderr of the command lazily.
If the process exits with a non-zero exit code,
reading from the bytestring will throw CmdException.
captureErrLazyNoThrow :: Cmd -> IO ByteString Source #
Capture the stderr of the command lazily. Ignores process exit code.
captureFdLazy :: Fd -> Cmd -> IO ByteString Source #
Capture the output of the fd of the command lazily.
If the process exits with a non-zero exit code,
reading from the bytestring will throw CmdException.
captureFdLazyNoThrow :: Fd -> Cmd -> IO ByteString Source #
Capture the output of the fd of the command lazily. Ignores process exit code.
pipeArgStrIn :: ToByteString b => b -> Cmd -> Cmd Source #
Pass an argument of the form /proc/self/fd/<n> to the process,
where n is the reader end of a pipe which the passed string is written to.
Arguments
| :: (QuickCmd a, ToByteString b) | |
| => b | The path to the executable, uses PATH |
| -> a | Either a |
>>>mq "cat" "/dev/null" (pipeArgIn 1 $ mq "cat" "/dev/null") <<< "somestr"
The first argument is the path, and the subsequent arguments are QuickCmdArg.
At the end you will either have an IO () (synchronous execution) or Cmd (which you can further use).
Minimal complete definition
quickCmdArg :: QuickCmdArg a => a -> Cmd -> Cmd Source #
class QuickCmdArg a Source #
A helper class to allow lightweight syntax for executing commands
Minimal complete definition
Instances
| QuickCmdArg String Source # | |
Defined in Procex.Quick | |
| QuickCmdArg ByteString Source # | |
Defined in Procex.Quick Methods quickCmdArg :: ByteString -> Cmd -> Cmd Source # | |
| QuickCmdArg (Cmd -> Cmd) Source # | |
Defined in Procex.Quick | |
toByteString :: ToByteString a => a -> ByteString Source #
class ToByteString a Source #
A helper class to convert to bytestrings with UTF-8 encoding
Minimal complete definition
Instances
| ToByteString ByteString Source # | |
Defined in Procex.Quick Methods toByteString :: ByteString -> ByteString Source # | |
| ToByteString ByteString Source # | |
Defined in Procex.Quick Methods toByteString :: ByteString -> ByteString0 Source # | |
| a ~ Char => ToByteString [a] Source # | |
Defined in Procex.Quick Methods toByteString :: [a] -> ByteString Source # | |