charon-0.1: Template
Safe HaskellSafe-Inferred
LanguageGHC2021

Charon.Runner

Description

This modules provides an executable for running charon.

Synopsis

Main functions

runCharon :: (HasCallStack, MonadAsync m, MonadFileReader m, MonadFileWriter m, MonadHandleWriter m, MonadIORef m, MonadMask m, MonadOptparse m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadTerminal m, MonadTime m) => m () Source #

Entry point for running Charon. Does everything: reads CLI args, optional Toml config, and creates the environment before running Charon.

runCmd :: forall m env. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadLoggerNS m, MonadFileReader m, MonadFileWriter m, MonadHandleWriter m, MonadIORef m, MonadMask m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => CommandP2 -> m () Source #

Runs Charon in the given environment. This is useful in conjunction with getConfiguration as an alternative runCharon, when we want to use a custom env.

Helpers

getConfiguration :: (HasCallStack, MonadFileReader m, MonadOptparse m, MonadPathReader m, MonadThrow m) => m (TomlConfig, CommandP2) Source #

Parses CLI Args and optional TomlConfig to produce the user configuration. For values shared between the CLI and Toml file, the CLI takes priority.

For example, if both the CLI and Toml file specify the trash home, then the CLI's value will be used.