Copyright | (c) 2017-2019 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
This module contains functions and data types to parse CLI inputs.
Synopsis
- data Command
- data NewOpts = NewOpts {}
- data ShowOpts
- = GhcList
- | LicenseList (Maybe String)
- summon :: Version -> (Command -> IO ()) -> IO ()
- summonCli :: IO ()
- runConfig :: ConfigOpts -> IO ()
- runScript :: ScriptOpts -> IO ()
- getFinalConfig :: NewOpts -> IO Config
- getCustomLicenseText :: LicenseName -> IO License
CLI data types
Represent all available commands
Options parsed with the new
command
NewOpts | |
|
Functions to parse CLI arguments and run summoner
summon :: Version -> (Command -> IO ()) -> IO () Source #
Main function that parses CLI
commands and runs them using given
Command
handler.
Runners
runConfig :: ConfigOpts -> IO () Source #
Runs config
command
Usage: summon config [-f|--file=FILENAME] Create a default TOML configuration file for summoner Available options: -h,--help Show this help text -f,--file=FILENAME Path to the toml file with configurations. If not specified '~/.summoner.toml' will be used by default
runScript :: ScriptOpts -> IO () Source #
Runs script
command.
Usage: summon script BUILD_TOOL (-g|--ghc GHC_VERSION) (-n|--name FILE_NAME) Create a new Haskell script Available options: -h,--help Show this help text -g,--ghc GHC_VERSION Version of the compiler to be used for script -n,--name FILE_NAME Name of the script file
Common helper functions
getFinalConfig :: NewOpts -> IO Config Source #
By the given NewOpts
return the final configurations.
getCustomLicenseText :: LicenseName -> IO License Source #
Get the customized License text for summon show license NAME
command.