Safe Haskell | Safe-Inferred |
---|
SimpleCmd
Description
Some simple String wrappers of readProcess
, readProcessWithExitCode
,
rawSystem
from the Haskell process library.
Simplest is
cmd_ :: String -> [String] -> IO ()
which outputs to stdout. For example:
cmd_ git [clone, url]
Then
cmd :: String -> [String] -> IO String
returns stdout as a String
.
There are also cmdBool
, cmdMaybe
, cmdLines
, shell
, and others.
Other examples:
grep_ pat file :: IO Bool
sudo c args :: IO ()
- cmd :: String -> [String] -> IO String
- cmd_ :: String -> [String] -> IO ()
- cmdBool :: String -> [String] -> IO Bool
- cmdIgnoreErr :: String -> [String] -> String -> IO String
- cmdLines :: String -> [String] -> IO [String]
- cmdlog :: String -> [String] -> IO ()
- cmdMaybe :: String -> [String] -> IO (Maybe String)
- cmdN :: String -> [String] -> IO ()
- cmdQuiet :: String -> [String] -> IO String
- cmdSilent :: String -> [String] -> IO ()
- cmdStdIn :: String -> [String] -> String -> IO String
- cmdStdErr :: String -> [String] -> IO (String, String)
- egrep_ :: String -> FilePath -> IO Bool
- grep :: String -> FilePath -> IO [String]
- grep_ :: String -> FilePath -> IO Bool
- logMsg :: String -> IO ()
- removePrefix :: String -> String -> String
- removeStrictPrefix :: String -> String -> String
- removeSuffix :: String -> String -> String
- shell :: String -> IO String
- shell_ :: String -> IO ()
- sudo :: String -> [String] -> IO ()
- (+-+) :: String -> String -> String
Documentation
'cmd c args' runs a command in a process and returns stdout
cmd_ :: String -> [String] -> IO ()Source
'cmd_ c args' runs command in a process, output goes to stdout and stderr
cmdBool :: String -> [String] -> IO BoolSource
'cmdBool c args' runs a command, and return Boolean status
cmdIgnoreErr :: String -> [String] -> String -> IO StringSource
'cmdIgnoreErr c args inp' runs a command with input, drops stderr, and return stdout
cmdMaybe :: String -> [String] -> IO (Maybe String)Source
'cmdMaybe c args' runs a command, maybe returning output if it succeeds
cmdN :: String -> [String] -> IO ()Source
'cmdN c args' dry-runs a command: prints command to stdout - more used for debugging
cmdQuiet :: String -> [String] -> IO StringSource
'cmdQuiet c args' runs a command hiding stderr, if it succeeds returns stdout
cmdSilent :: String -> [String] -> IO ()Source
'cmdSilent c args' runs a command hiding stdout: stderr is only output if it fails.
cmdStdIn :: String -> [String] -> String -> IO StringSource
'cmdStdIn c args inp' runs a command, passing input string as stdin, and returns stdout
cmdStdErr :: String -> [String] -> IO (String, String)Source
'cmdStdErr c args' runs command in a process, returning stdout and stderr
egrep_ :: String -> FilePath -> IO BoolSource
'egrep_ pat file' greps extended regexp in file, and returns Boolean status
'grep_ pat file' greps pattern in file and returns Boolean status
removePrefix :: String -> String -> StringSource
'removePrefix prefix original' removes prefix from string if present
removeStrictPrefix :: String -> String -> StringSource
'removeStrictPrefix prefix original' removes prefix, or fails with error'
removeSuffix :: String -> String -> StringSource
'removeSuffix suffix original' removes suffix from string if present
'sudo c args' runs a command as sudo