-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Miscellaneous utilities for building and working with command line interfaces
--
-- Convenience functions for writing command line interfaces, providing
-- facilities for logging, process management, and printing to the
-- terminal.
@package cli-extras
@version 0.2.1.1
module Bindings.Cli.Coreutils
cp :: FilePath
module Cli.Extras.SubExcept
-- | Wrap a Prism' in a newtype to avoid impredicativity problems
newtype WrappedPrism' a b
WrappedPrism' :: Prism' a b -> WrappedPrism' a b
[unWrappedPrism'] :: WrappedPrism' a b -> Prism' a b
newtype SubExceptT e eSub (m :: Type -> Type) a
SubExceptT :: ReaderT (WrappedPrism' e eSub) m a -> SubExceptT e eSub (m :: Type -> Type) a
[unSubExceptT] :: SubExceptT e eSub (m :: Type -> Type) a -> ReaderT (WrappedPrism' e eSub) m a
runSubExceptT :: Prism' e eSub -> SubExceptT e eSub m a -> m a
instance GHC.Internal.Base.Applicative m => GHC.Internal.Base.Applicative (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError eSub (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.Log.MonadLog o m => Control.Monad.Log.MonadLog o (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Cli.Extras.SubExcept.SubExceptT e eSub m)
instance Control.Monad.Trans.Class.MonadTrans (Cli.Extras.SubExcept.SubExceptT e eSub)
-- | Types and functions dealing with strings to be printed on terminal.
module Cli.Extras.TerminalString
-- | Printable text on terminals
--
-- Represents text with an optional color code.
data TerminalString
TerminalString_Normal :: Text -> TerminalString
TerminalString_Colorized :: Color -> Text -> TerminalString
render :: Bool -> Maybe Int -> [TerminalString] -> Text
-- | Safely print the string with the given ANSI control codes, resetting
-- in the end.
putStrWithSGR :: MonadIO m => [SGR] -> Handle -> Bool -> Text -> m ()
getTerminalWidth :: IO (Maybe Int)
-- | Code for https://en.wikipedia.org/wiki/Enquiry_character. On
-- VT-100 descendants (most modern UNIX terminal emulators), an ENQ
-- character can be generated by pressing Ctrl+E.
enquiryCode :: String
instance GHC.Classes.Eq Cli.Extras.TerminalString.TerminalString
instance GHC.Classes.Ord Cli.Extras.TerminalString.TerminalString
instance GHC.Internal.Show.Show Cli.Extras.TerminalString.TerminalString
module Cli.Extras.Theme
data CliTheme
CliTheme :: Text -> Text -> Text -> SpinnerTheme -> CliTheme
[_cliTheme_done] :: CliTheme -> Text
[_cliTheme_failed] :: CliTheme -> Text
[_cliTheme_arrow] :: CliTheme -> Text
[_cliTheme_spinner] :: CliTheme -> SpinnerTheme
type SpinnerTheme = [Text]
unicodeTheme :: CliTheme
noUnicodeTheme :: CliTheme
module Cli.Extras.Types
data Output
Output_Log :: WithSeverity Text -> Output
Output_LogRaw :: WithSeverity Text -> Output
Output_Write :: [TerminalString] -> Output
Output_Overwrite :: [TerminalString] -> Output
Output_ClearLine :: Output
type CliLog (m :: Type -> Type) = MonadLog Output m
type CliThrow e (m :: Type -> Type) = MonadError e m
-- | Log a message to the console.
--
-- The message is guaranteed to be logged uninterrupted, even if there
-- are ongoing spinners.
putLog :: CliLog m => Severity -> Text -> m ()
newtype DieT e (m :: Type -> Type) a
DieT :: ReaderT (e -> (Text, ExitCode)) (LoggingT Output m) a -> DieT e (m :: Type -> Type) a
[unDieT] :: DieT e (m :: Type -> Type) a -> ReaderT (e -> (Text, ExitCode)) (LoggingT Output m) a
data CliConfig e
CliConfig :: IORef Severity -> Bool -> Bool -> MVar Bool -> IORef Bool -> IORef ([Bool], [TerminalString]) -> (e -> (Text, ExitCode)) -> CliTheme -> CliConfig e
-- | We are capable of changing the log level at runtime
[_cliConfig_logLevel] :: CliConfig e -> IORef Severity
-- | Disallow coloured output
[_cliConfig_noColor] :: CliConfig e -> Bool
-- | Disallow spinners
[_cliConfig_noSpinner] :: CliConfig e -> Bool
-- | Whether the last message was an Overwrite output
[_cliConfig_lock] :: CliConfig e -> MVar Bool
-- | Whether the user tip (to make verbose) was already displayed
[_cliConfig_tipDisplayed] :: CliConfig e -> IORef Bool
-- | Stack of logs from nested spinners
[_cliConfig_spinnerStack] :: CliConfig e -> IORef ([Bool], [TerminalString])
-- | Handler for failures. Determines, given an error, what message should
-- be printed, and what the exit status should be.
[_cliConfig_errorLogExitCode] :: CliConfig e -> e -> (Text, ExitCode)
-- | Theme strings for spinners
[_cliConfig_theme] :: CliConfig e -> CliTheme
class Monad m => HasCliConfig e (m :: Type -> Type) | m -> e
getCliConfig :: HasCliConfig e m => m (CliConfig e)
newtype CliT e (m :: Type -> Type) a
CliT :: ReaderT (CliConfig e) (DieT e m) a -> CliT e (m :: Type -> Type) a
[unCliT] :: CliT e (m :: Type -> Type) a -> ReaderT (CliConfig e) (DieT e m) a
instance GHC.Internal.Base.Applicative m => GHC.Internal.Base.Applicative (Cli.Extras.Types.CliT e m)
instance GHC.Internal.Base.Applicative m => GHC.Internal.Base.Applicative (Cli.Extras.Types.DieT e m)
instance GHC.Classes.Eq Cli.Extras.Types.Output
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Cli.Extras.Types.CliT e m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Cli.Extras.Types.DieT e m)
instance GHC.Internal.Base.Monad m => Cli.Extras.Types.HasCliConfig e (Cli.Extras.Types.CliT e m)
instance Cli.Extras.Types.HasCliConfig e m => Cli.Extras.Types.HasCliConfig e (Control.Monad.Trans.Except.ExceptT e m)
instance Cli.Extras.Types.HasCliConfig e m => Cli.Extras.Types.HasCliConfig e (Control.Monad.Trans.Reader.ReaderT r m)
instance Cli.Extras.Types.HasCliConfig e m => Cli.Extras.Types.HasCliConfig e (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, Cli.Extras.Types.HasCliConfig e m) => Cli.Extras.Types.HasCliConfig e (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Cli.Extras.Types.CliT e m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Cli.Extras.Types.DieT e m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Cli.Extras.Types.CliT e m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Cli.Extras.Types.DieT e m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Error.Class.MonadError e (Cli.Extras.Types.CliT e m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Error.Class.MonadError e (Cli.Extras.Types.DieT e m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (Cli.Extras.Types.CliT e m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (Cli.Extras.Types.DieT e m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Cli.Extras.Types.CliT e m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Cli.Extras.Types.DieT e m)
instance GHC.Internal.Base.Monad m => Control.Monad.Log.MonadLog Cli.Extras.Types.Output (Cli.Extras.Types.CliT e m)
instance GHC.Internal.Base.Monad m => Control.Monad.Log.MonadLog Cli.Extras.Types.Output (Cli.Extras.Types.DieT e m)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Cli.Extras.Types.CliT e m)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Cli.Extras.Types.DieT e m)
instance GHC.Internal.Base.Monad m => Control.Monad.Reader.Class.MonadReader (Cli.Extras.Types.CliConfig e) (Cli.Extras.Types.CliT e m)
instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Cli.Extras.Types.DieT e m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Cli.Extras.Types.CliT e m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Cli.Extras.Types.DieT e m)
instance Control.Monad.Trans.Class.MonadTrans (Cli.Extras.Types.CliT e)
instance Control.Monad.Trans.Class.MonadTrans (Cli.Extras.Types.DieT e)
instance GHC.Classes.Ord Cli.Extras.Types.Output
instance GHC.Internal.Show.Show Cli.Extras.Types.Output
-- | Provides a logging handler that facilitates safe ouputting to terminal
-- using MVar based locking. | Spinner.hs and Process.hs work on this
-- guarantee.
module Cli.Extras.Logging
-- | Indicates unstructured errors form one variant (or conceptual
-- projection) of the error type.
--
-- Shouldn't really use this, but who has time to clean up that much!
class AsUnstructuredError e
asUnstructuredError :: AsUnstructuredError e => Prism' e Text
-- | Create a new CliConfig, initialized with the provided values.
newCliConfig :: Severity -> Bool -> Bool -> (e -> (Text, ExitCode)) -> IO (CliConfig e)
runCli :: MonadIO m => CliConfig e -> CliT e m a -> m a
verboseLogLevel :: Severity
isOverwrite :: Output -> Bool
getSeverity :: Output -> Maybe Severity
getLogLevel :: (MonadIO m, HasCliConfig e m) => m Severity
setLogLevel :: (MonadIO m, HasCliConfig e m) => Severity -> m ()
-- | Log a message to the console.
--
-- The message is guaranteed to be logged uninterrupted, even if there
-- are ongoing spinners.
putLog :: CliLog m => Severity -> Text -> m ()
-- | Like putLog but without the implicit newline added.
putLogRaw :: CliLog m => Severity -> Text -> m ()
-- | Like `putLog Alert` but also abrupts the program.
failWith :: (CliThrow e m, AsUnstructuredError e) => Text -> m a
-- | Log an error as though it were a warning, in a non-fatal way.
errorToWarning :: (HasCliConfig e m, CliLog m) => e -> m ()
-- | Intercept ExitFailure exceptions and log the given alert before
-- exiting.
--
-- This is useful when you want to provide contextual information to a
-- deeper failure.
withExitFailMessage :: (CliLog m, MonadCatch m) => Text -> m a -> m a
-- | Log a message to standard output.
writeLog :: MonadIO m => Bool -> Bool -> WithSeverity Text -> m ()
-- | Allows the user to immediately switch to verbose logging when a
-- particular sequence of characters is read from the terminal.
--
-- Call this function in a thread, and kill it to turn off keystroke
-- monitoring.
allowUserToMakeLoggingVerbose :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => String -> Text -> m ()
-- | Like getChar but also retrieves the subsequently pressed keys.
--
-- Allowing, for example, the ↑ key, which consists of the three
-- characters ['ESC','[',A] to be distinguished from an actual
-- ESC character input.
getChars :: IO String
-- | Fork a computation in CliT, sharing the configuration with the
-- child thread.
fork :: (HasCliConfig e m, MonadIO m) => CliT e IO () -> m ThreadId
instance Cli.Extras.Logging.AsUnstructuredError Data.Text.Internal.Text
-- | Provides a simple CLI spinner that interoperates cleanly with the rest
-- of the logging output.
module Cli.Extras.Spinner
-- | Run an action with a CLI spinner.
withSpinner :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> m a -> m a
-- | A spinner that leaves no trail after a successful run.
--
-- Use if you wish the spinner to be ephemerally visible to the user.
--
-- The 'no trail' property automatically carries over to sub-spinners (in
-- that they won't leave a trail either).
withSpinnerNoTrail :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> m a -> m a
-- | Advanced version that controls the display and content of the trail
-- message.
withSpinner' :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> Maybe (a -> Text) -> m a -> m a
-- | An extension of Process that integrates with logging
-- (Logging) and is thus spinner friendly.
module Cli.Extras.Process
-- | Indicates arbitrary process failures form one variant (or conceptual
-- projection) of the error type.
class AsProcessFailure e
asProcessFailure :: AsProcessFailure e => Prism' e ProcessFailure
data ProcessFailure
ProcessFailure :: CmdSpec -> Int -> ProcessFailure
data ProcessSpec
ProcessSpec :: !CreateProcess -> !Maybe (Map String String -> Map String String) -> ProcessSpec
[_processSpec_createProcess] :: ProcessSpec -> !CreateProcess
[_processSpec_overrideEnv] :: ProcessSpec -> !Maybe (Map String String -> Map String String)
-- | Like callCommand, but logging (with Debug severity) the
-- process which was started.
callCommand :: (MonadIO m, CliLog m) => String -> m ()
-- | Like callProcess, but logging (with Debug severity) the
-- process which was started.
callProcess :: (MonadIO m, CliLog m) => String -> [String] -> m ()
-- | Like readProcess, but such that each of the child processes'
-- standard output streams (stdout and stderr) is logged, with the
-- corresponding severity.
--
-- Usually, this function is called as callProcessAndLogOutput
-- (Debug, Error). If the child process is known to print diagnostic
-- or informative messages to stderr, it is advisable to call
-- callProcessAndLogOutput with a non-Error severity for stderr,
-- for example callProcessAndLogOutput (Debug, Debug).
callProcessAndLogOutput :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m) => (Severity, Severity) -> ProcessSpec -> m ()
-- | Like createProcess, but logging (with Debug severity)
-- the process which was started.
createProcess :: (MonadIO m, CliLog m) => ProcessSpec -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
-- | Like createProcess_, but logging (with Debug severity)
-- the process which was started.
createProcess_ :: (MonadIO m, CliLog m) => String -> ProcessSpec -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
-- | Aborts the computation (using throwError) when given a
-- non-ExitSuccess ExitCode.
throwExitCode :: (CliThrow e m, AsProcessFailure e) => ProcessSpec -> ExitCode -> m ()
overCreateProcess :: (CreateProcess -> CreateProcess) -> ProcessSpec -> ProcessSpec
proc :: FilePath -> [String] -> ProcessSpec
readCreateProcessWithExitCode :: (MonadIO m, CliLog m) => ProcessSpec -> m (ExitCode, String, String)
-- | Like readProcess, but such that each of the child processes'
-- standard output streams (stdout and stderr) is logged, with the
-- corresponding severity.
--
-- Usually, this function is called as readProcessAndLogOutput
-- (Debug, Error). If the child process is known to print diagnostic
-- or informative messages to stderr, it is advisable to call
-- readProcessAndLogOutput with a non-Error severity for stderr,
-- for example readProcessAndLogOutput (Debug, Debug).
readProcessAndLogOutput :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m) => (Severity, Severity) -> ProcessSpec -> m Text
readProcessAndLogStderr :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m) => Severity -> ProcessSpec -> m Text
readProcessJSONAndLogStderr :: (FromJSON a, MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m) => Severity -> ProcessSpec -> m a
-- | Pretty print a CmdSpec
reconstructCommand :: CmdSpec -> Text
-- | Runs a process to completion, aborting the computation (using
-- throwExitCode) in case of a non-ExitSuccess exit status.
runProcess_ :: (MonadIO m, CliLog m, CliThrow e m, MonadMask m, AsProcessFailure e) => ProcessSpec -> m ()
setCwd :: Maybe FilePath -> ProcessSpec -> ProcessSpec
setDelegateCtlc :: Bool -> ProcessSpec -> ProcessSpec
setEnvOverride :: (Map String String -> Map String String) -> ProcessSpec -> ProcessSpec
shell :: String -> ProcessSpec
-- | Wrapper around waitForProcess
waitForProcess :: MonadIO m => ProcessHandle -> m ExitCode
-- | A wrapper for callProcessAndLogOutput with sensible default
-- verbosities: standard output gets the Notice severity and
-- standard error gets Error.
runProc :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m, MonadMask m) => ProcessSpec -> m ()
-- | Like runProc, but the child process' output and error streams
-- get the Debug severity.
runProcSilently :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m, MonadMask m) => ProcessSpec -> m ()
-- | A wrapper for readProcessAndLogOutput with sensible default
-- verbosities: standard output gets the Debug severity and
-- standard error gets Error.
--
-- The child process' output gets the Debug severity rather than
-- the Notice severity because it is first and foremost /returned
-- by this function/, so you can log it afterwards in a reasonable
-- manner.
readProc :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m) => ProcessSpec -> m Text
instance Cli.Extras.Process.AsProcessFailure Cli.Extras.Process.ProcessFailure
instance GHC.Internal.Show.Show Cli.Extras.Process.ProcessFailure
-- | |
module Cli.Extras
type CliLog (m :: Type -> Type) = MonadLog Output m
type CliThrow e (m :: Type -> Type) = MonadError e m
newtype CliT e (m :: Type -> Type) a
CliT :: ReaderT (CliConfig e) (DieT e m) a -> CliT e (m :: Type -> Type) a
[unCliT] :: CliT e (m :: Type -> Type) a -> ReaderT (CliConfig e) (DieT e m) a
runCli :: MonadIO m => CliConfig e -> CliT e m a -> m a
data CliConfig e
class Monad m => HasCliConfig e (m :: Type -> Type) | m -> e
getCliConfig :: HasCliConfig e m => m (CliConfig e)
data Output
-- | Run an action with a CLI spinner.
withSpinner :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> m a -> m a
-- | A spinner that leaves no trail after a successful run.
--
-- Use if you wish the spinner to be ephemerally visible to the user.
--
-- The 'no trail' property automatically carries over to sub-spinners (in
-- that they won't leave a trail either).
withSpinnerNoTrail :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> m a -> m a
-- | Advanced version that controls the display and content of the trail
-- message.
withSpinner' :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> Maybe (a -> Text) -> m a -> m a
-- | Indicates unstructured errors form one variant (or conceptual
-- projection) of the error type.
--
-- Shouldn't really use this, but who has time to clean up that much!
class AsUnstructuredError e
asUnstructuredError :: AsUnstructuredError e => Prism' e Text
-- | Create a new CliConfig, initialized with the provided values.
newCliConfig :: Severity -> Bool -> Bool -> (e -> (Text, ExitCode)) -> IO (CliConfig e)
getLogLevel :: (MonadIO m, HasCliConfig e m) => m Severity
-- | Log a message to the console.
--
-- The message is guaranteed to be logged uninterrupted, even if there
-- are ongoing spinners.
putLog :: CliLog m => Severity -> Text -> m ()
-- | Like `putLog Alert` but also abrupts the program.
failWith :: (CliThrow e m, AsUnstructuredError e) => Text -> m a
-- | Log an error as though it were a warning, in a non-fatal way.
errorToWarning :: (HasCliConfig e m, CliLog m) => e -> m ()
-- | Intercept ExitFailure exceptions and log the given alert before
-- exiting.
--
-- This is useful when you want to provide contextual information to a
-- deeper failure.
withExitFailMessage :: (CliLog m, MonadCatch m) => Text -> m a -> m a
-- | Classes of severity for log messages. These have been chosen to match
-- syslog severity levels
data Severity
-- | System is unusable. By syslog convention, this level should
-- not be used by applications.
Emergency :: Severity
-- | Should be corrected immediately.
Alert :: Severity
-- | Critical conditions.
Critical :: Severity
-- | Error conditions.
Error :: Severity
-- | May indicate that an error will occur if action is not taken.
Warning :: Severity
-- | Events that are unusual, but not error conditions.
Notice :: Severity
-- | Normal operational messages that require no action.
Informational :: Severity
-- | Information useful to developers for debugging the application.
Debug :: Severity
-- | Indicates arbitrary process failures form one variant (or conceptual
-- projection) of the error type.
class AsProcessFailure e
asProcessFailure :: AsProcessFailure e => Prism' e ProcessFailure
data ProcessFailure
ProcessFailure :: CmdSpec -> Int -> ProcessFailure
data ProcessSpec
ProcessSpec :: !CreateProcess -> !Maybe (Map String String -> Map String String) -> ProcessSpec
[_processSpec_createProcess] :: ProcessSpec -> !CreateProcess
[_processSpec_overrideEnv] :: ProcessSpec -> !Maybe (Map String String -> Map String String)
-- | Like callCommand, but logging (with Debug severity) the
-- process which was started.
callCommand :: (MonadIO m, CliLog m) => String -> m ()
-- | Like callProcess, but logging (with Debug severity) the
-- process which was started.
callProcess :: (MonadIO m, CliLog m) => String -> [String] -> m ()
-- | Like readProcess, but such that each of the child processes'
-- standard output streams (stdout and stderr) is logged, with the
-- corresponding severity.
--
-- Usually, this function is called as callProcessAndLogOutput
-- (Debug, Error). If the child process is known to print diagnostic
-- or informative messages to stderr, it is advisable to call
-- callProcessAndLogOutput with a non-Error severity for stderr,
-- for example callProcessAndLogOutput (Debug, Debug).
callProcessAndLogOutput :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m) => (Severity, Severity) -> ProcessSpec -> m ()
-- | Like createProcess, but logging (with Debug severity)
-- the process which was started.
createProcess :: (MonadIO m, CliLog m) => ProcessSpec -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
-- | Like createProcess_, but logging (with Debug severity)
-- the process which was started.
createProcess_ :: (MonadIO m, CliLog m) => String -> ProcessSpec -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
-- | Aborts the computation (using throwError) when given a
-- non-ExitSuccess ExitCode.
throwExitCode :: (CliThrow e m, AsProcessFailure e) => ProcessSpec -> ExitCode -> m ()
overCreateProcess :: (CreateProcess -> CreateProcess) -> ProcessSpec -> ProcessSpec
proc :: FilePath -> [String] -> ProcessSpec
readCreateProcessWithExitCode :: (MonadIO m, CliLog m) => ProcessSpec -> m (ExitCode, String, String)
-- | Like readProcess, but such that each of the child processes'
-- standard output streams (stdout and stderr) is logged, with the
-- corresponding severity.
--
-- Usually, this function is called as readProcessAndLogOutput
-- (Debug, Error). If the child process is known to print diagnostic
-- or informative messages to stderr, it is advisable to call
-- readProcessAndLogOutput with a non-Error severity for stderr,
-- for example readProcessAndLogOutput (Debug, Debug).
readProcessAndLogOutput :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m) => (Severity, Severity) -> ProcessSpec -> m Text
readProcessAndLogStderr :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m) => Severity -> ProcessSpec -> m Text
readProcessJSONAndLogStderr :: (FromJSON a, MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m) => Severity -> ProcessSpec -> m a
-- | Pretty print a CmdSpec
reconstructCommand :: CmdSpec -> Text
-- | Runs a process to completion, aborting the computation (using
-- throwExitCode) in case of a non-ExitSuccess exit status.
runProcess_ :: (MonadIO m, CliLog m, CliThrow e m, MonadMask m, AsProcessFailure e) => ProcessSpec -> m ()
setCwd :: Maybe FilePath -> ProcessSpec -> ProcessSpec
setDelegateCtlc :: Bool -> ProcessSpec -> ProcessSpec
setEnvOverride :: (Map String String -> Map String String) -> ProcessSpec -> ProcessSpec
shell :: String -> ProcessSpec
-- | Wrapper around waitForProcess
waitForProcess :: MonadIO m => ProcessHandle -> m ExitCode