Implement functions to run Shell commands easier in the Iris applications. A simple implementation would be something like this (inspired by shellmet):
-- | Run the command but don't print it
shellSilent
:: FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO ()
-- | Run the command and print the command itself to stderr
shell
:: Text -- ^ Prompt
-> FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO ()
-- | Run the command, don't print it and return its stdout
shellRetSilent
:: FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO Text
-- | Run the command, print it with prompt to stderr and return its stdout
shellRet
:: Text -- ^ Prompt
-> FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO Text
Alternatively, we can integrate with one of the existing and battle-tested libraries:
Implement functions to run Shell commands easier in the Iris applications. A simple implementation would be something like this (inspired by
shellmet
):Alternatively, we can integrate with one of the existing and battle-tested libraries:
Possible usage inside Iris itself —
Iris.Browse
module:https://github.com/chshersh/iris/blob/7e694331069c7732fa70235767c472e23dbf402b/src/Iris/Browse.hs#L69-L74
Open questions:
MonadReader CliEnv
to use something specific for running shell commands?