-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Simple String-based process commands
--   
--   Thin wrappers over System.Process (readProcess,
--   readProcessWithExitCode, and rawSystem). The idea is to provide some
--   simple common idioms for easy calling out to commands from programs.
--   For more advanced shell-scripting or streaming use turtle, shelly,
--   command, etc.
@package simple-cmd
@version 0.1.3.1


-- | Some simple String wrappers of <a>readProcess</a>,
--   <a>readProcessWithExitCode</a>, <a>rawSystem</a> from the Haskell
--   <a>process</a> library.
--   
--   Simplest is
--   
--   <pre>
--   cmd_ :: String -&gt; [String] -&gt; IO ()
--   </pre>
--   
--   which outputs to stdout. For example:
--   
--   <pre>
--   cmd_ "git" ["clone", url]
--   </pre>
--   
--   Then
--   
--   <pre>
--   cmd :: String -&gt; [String] -&gt; IO String
--   </pre>
--   
--   returns stdout as a <tt>String</tt>.
--   
--   There are also <tt>cmdBool</tt>, <tt>cmdMaybe</tt>, <tt>cmdLines</tt>,
--   <tt>shell</tt>, and others.
--   
--   Other examples:
--   
--   <pre>
--   grep_ pat file :: IO Bool
--   </pre>
--   
--   <pre>
--   sudo c args :: IO ()
--   </pre>
module SimpleCmd

-- | 'cmd c args' runs a command in a process and returns stdout
cmd :: String -> [String] -> IO String

-- | 'cmd_ c args' runs command in a process, output goes to stdout and
--   stderr
cmd_ :: String -> [String] -> IO ()

-- | 'cmdBool c args' runs a command, and return Boolean status
cmdBool :: String -> [String] -> IO Bool

-- | 'cmdIgnoreErr c args inp' runs a command with input, drops stderr, and
--   return stdout
cmdIgnoreErr :: String -> [String] -> String -> IO String

-- | 'cmdLines c args' runs a command, and returns list of stdout lines
cmdLines :: String -> [String] -> IO [String]

-- | 'cmdLog c args' logs a command with a datestamp
cmdlog :: String -> [String] -> IO ()

-- | 'cmdMaybe c args' runs a command, maybe returning output if it
--   succeeds
cmdMaybe :: String -> [String] -> IO (Maybe String)

-- | 'cmdN c args' dry-runs a command: prints command to stdout - more used
--   for debugging
cmdN :: String -> [String] -> IO ()

-- | 'cmdQuiet c args' runs a command hiding stderr, if it succeeds returns
--   stdout
cmdQuiet :: String -> [String] -> IO String

-- | 'cmdSilent c args' runs a command hiding stdout: stderr is only output
--   if it fails.
cmdSilent :: String -> [String] -> IO ()

-- | 'cmdStdIn c args inp' runs a command, passing input string as stdin,
--   and returns stdout
cmdStdIn :: String -> [String] -> String -> IO String

-- | 'cmdStdErr c args' runs command in a process, returning stdout and
--   stderr
cmdStdErr :: String -> [String] -> IO (String, String)

-- | 'egrep_ pat file' greps extended regexp in file, and returns Boolean
--   status
egrep_ :: String -> FilePath -> IO Bool

-- | 'grep pat file' greps pattern in file, and returns list of matches
grep :: String -> FilePath -> IO [String]

-- | 'grep_ pat file' greps pattern in file and returns Boolean status
grep_ :: String -> FilePath -> IO Bool

-- | 'logMsg msg' outputs message with a timestamp
logMsg :: String -> IO ()

-- | 'removePrefix prefix original' removes prefix from string if present
removePrefix :: String -> String -> String

-- | 'removeStrictPrefix prefix original' removes prefix, or fails with
--   error'
removeStrictPrefix :: String -> String -> String

-- | 'removeSuffix suffix original' removes suffix from string if present
removeSuffix :: String -> String -> String

-- | 'shell cs' runs a command string in a shell, and returns stdout
shell :: String -> IO String

-- | 'shell_ c' runs a command string in a shell, output goes to stdout
shell_ :: String -> IO ()

-- | 'sudo c args' runs a command as sudo
sudo :: String -> [String] -> IO ()

-- | Combine two strings with a single space
(+-+) :: String -> String -> String
infixr 4 +-+


-- | Some wrappers for git commands.
module SimpleCmd.Git

-- | 'git c args' runs git command and return output
git :: String -> [String] -> IO String

-- | 'git_ c args' run git command with output to stdout and stderr
git_ :: String -> [String] -> IO ()

-- | <a>gitBranch</a> returns the git branch of the current directory
gitBranch :: IO String

-- | <a>gitDiffQuiet</a> checks if unchanged
gitDiffQuiet :: [String] -> IO Bool

-- | 'grepGitConfig pat' greps ".git/config" for extended regexp
grepGitConfig :: String -> IO Bool

-- | 'isGitDir dir' checks if directory has a .git/ subdir
isGitDir :: FilePath -> IO Bool

-- | <a>rwGitDir</a> checks if a git repo is under ssh
rwGitDir :: IO Bool


-- | This Rpm module currently only provides <tt>rpmspec</tt>.
module SimpleCmd.Rpm

-- | 'rpmspec args maybe-queryformat specfile' runs rpmspec query on file
--   with optional args (a newline is appended to any queryformat)
rpmspec :: [String] -> Maybe String -> FilePath -> IO [String]
