shrun-0.9: A utility program for running shell commands concurrently.
Safe HaskellNone
LanguageGHC2021

Shrun.Configuration

Synopsis

Documentation

mergeConfig :: (HasCallStack, MonadTerminal m, MonadThrow m) => Args -> Maybe Toml -> m MergedConfig Source #

Merges Args and Toml together, filling in necessary defaults and doing some light processing.

We want this function to do as much to prepare the final config as possible. For instance, in addition to filling in defaults, we also process commands via the legend (MonadThrow) and detect the terminal width for command logging's lineTrunc field (MonadTerminal).

This is very nearly pure, except for the aforementioned effects. The only remaining tasks the Env needs to take care of is IO that we really can't test anyway, such as opening file handles and creating queues.