procex-0.2.2: Ergonomic process launching with extreme flexibility and speed
Safe HaskellNone
LanguageHaskell2010

Procex.Quick

Synopsis

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, ToByteString b) => Cmd -> b -> a infixl 1 Source #

Pass a string as stdin.

(<|) :: 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.

captureFd :: Fd -> Cmd -> IO ByteString Source #

Capture the output of the fd of the command strictly, err if the command exits with a non-zero exit code.

captureFdNoThrow :: Fd -> Cmd -> IO ByteString Source #

Capture the output of the fd of the command strictly. 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. Garbage collection will close the pipe.

captureFdLazyNoThrow :: Fd -> Cmd -> IO ByteString Source #

Capture the output of the fd of the command lazily. Ignores process exit code. Garbage collection will close the pipe.

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.

mq Source #

Arguments

:: (QuickCmd a, ToByteString b) 
=> b

The path to the executable, uses PATH

-> a

Either a Cmd, an IO (), or a function that takes Cmd -> Cmd , String or ByteString

>>> 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).

class QuickCmd a Source #

Minimal complete definition

quickCmd

Instances

Instances details
QuickCmd Cmd Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmd :: Cmd -> Cmd Source #

a ~ () => QuickCmd (IO a) Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmd :: Cmd -> IO a Source #

(QuickCmdArg a, QuickCmd b) => QuickCmd (a -> b) Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmd :: Cmd -> a -> b Source #

class QuickCmdArg a Source #

A helper class to allow lightweight syntax for executing commands

Minimal complete definition

quickCmdArg

Instances

Instances details
QuickCmdArg String Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmdArg :: String -> Cmd -> Cmd Source #

QuickCmdArg ByteString Source # 
Instance details

Defined in Procex.Quick

QuickCmdArg (Cmd -> Cmd) Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmdArg :: (Cmd -> Cmd) -> Cmd -> Cmd Source #

class ToByteString a Source #

A helper class to convert to bytestrings with UTF-8 encoding

Minimal complete definition

toByteString

Instances

Instances details
ToByteString ByteString Source # 
Instance details

Defined in Procex.Quick

ToByteString ByteString Source # 
Instance details

Defined in Procex.Quick

a ~ Char => ToByteString [a] Source # 
Instance details

Defined in Procex.Quick

Methods

toByteString :: [a] -> ByteString Source #