Copyright | (c) 2022 Dmitrii Kovanikov |
---|---|
License | MPL-2.0 |
Maintainer | Dmitrii Kovanikov <kovanikov@gmail.com> |
Stability | Experimental |
Portability | Portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Settings of a CLI app environment.
You're encouraged to create a separate module MyApp.Settings
and put settings
for your custom application there following the below pattern:
module MyApp.Settings (appSettings) where -- data data for your CLI arguments and CLI parser import MyApp.Cli (Options, optionsP) -- custom application environment import MyApp.Env (Env) import qualified Iris import qualified Paths_myapp as Autogen appSettings :: Env -> Iris.CliEnvSettings
Options Env appSettings env = Iris.defaultCliEnvSettings { -- CLI parser for Options Iris.cliEnvSettingsCmdParser
= optionsP -- Custom app environment , Iris.cliEnvSettingsAppEnv
= env -- Application name , Iris.cliEnvSettingsAppName
= Just "myapp" -- Short app description , Iris.cliEnvSettingsHeaderDesc
= "myapp - short description" -- Long app description to appear in --help , Iris.cliEnvSettingsProgDesc
= "A tool for ..." -- How to print app version with the --version flag , Iris.cliEnvSettingsVersionSettings
= Just (Iris.defaultVersionSettings
Autogen.version) { Iris.versionSettingsMkDesc
= v -> "MyApp v" <> v } }
Since: 0.1.0.0
Synopsis
- data CliEnvSettings (cmd :: Type) (appEnv :: Type) = CliEnvSettings {}
- defaultCliEnvSettings :: CliEnvSettings () ()
Settings for the CLI app
data CliEnvSettings (cmd :: Type) (appEnv :: Type) Source #
CliEnvSettings | |
|
defaultCliEnvSettings :: CliEnvSettings () () Source #
Default Iris app settings.
Since: 0.0.0.0