summoner-2.0.1.0: Tool for scaffolding fully configured batteries-included production-level Haskell projects.
Copyright(c) 2017-2019 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Summoner.CLI

Description

This module contains functions and data types to parse CLI inputs.

Synopsis

CLI data types

data Command Source #

Represent all available commands

Constructors

New NewOpts

new command creates a new project

Script ScriptOpts

script command creates Haskell script

ShowInfo ShowOpts

show command shows supported licenses or GHC versions

Config ConfigOpts

config command creates the TOML configuration file

data NewOpts Source #

Options parsed with the new command

Constructors

NewOpts 

Fields

data ShowOpts Source #

Commands parsed with show command

Constructors

GhcList 
LicenseList (Maybe String) 

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.

summonCli :: IO () Source #

Runs summoner in CLI mode.

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.