SKAT engine
Safe HaskellSafe-Inferred

Command

Synopsis

Documentation

data Command #

GenCommand represents the instructions the program will execute. It contains what we are going to copy, its name and content substitutions as well as whether or not to treat the artifact as a module.

Constructors

Gen 

Fields

  • what' :: String

    What do we want to copy, or which template do we want to use.

  • name' :: String

    The name that will be given to the new files.

  • sub' :: Map String String

    Mapping of values to substitute in the templates content

  • asModule' :: Bool

    Should the output files be treated as a module. If it is a module it will create a directory with the name and put the files inside.

  • output' :: Maybe RelDir

    Alternate output directory. Use to override config parameter

Init 

Instances

Instances details
Show Command # 
Instance details

Defined in Command

Methods

showsPrec :: Int -> Command -> ShowS

show :: Command -> String

showList :: [Command] -> ShowS

data GenCommand #

Constructors

GenCommand 

Fields

  • what :: String

    What do we want to copy, or which template do we want to use.

  • name :: String

    The name that will be given to the new files.

  • sub :: Map String String

    Mapping of values to substitute in the templates content

  • asModule :: Bool

    Should the output files be treated as a module. If it is a module it will create a directory with the name and put the files inside.

  • output :: Maybe RelDir

    Alternate output directory. Use to override config parameter

data InitCommand #

Constructors

InitCommand 

Instances

Instances details
Show InitCommand # 
Instance details

Defined in Command

Methods

showsPrec :: Int -> InitCommand -> ShowS

show :: InitCommand -> String

showList :: [InitCommand] -> ShowS

data CommandError #

Encompasses all possible errors in the Command module

Constructors

InvalidSubstitutionError String

If substitution does is not a key/value pair or it contains empty strings

DuplicateSubstitutionError String

If more than one value has been passed for the same substitution key.

Instances

Instances details
Show CommandError # 
Instance details

Defined in Command

Methods

showsPrec :: Int -> CommandError -> ShowS

show :: CommandError -> String

showList :: [CommandError] -> ShowS

mkDuplicateOutputMapError :: (String, String) -> Map String String -> CommandError #

mkSubstitutions :: String -> Either String (Map String String) #

mkOptionalOutput :: String -> Either String (Maybe RelDir) #

mkGenCommand #

Arguments

:: String

What do we want to copy, or which template do we want to use.

-> String

The name that will be given to the new files.

-> Map String String

Mapping of values to substitute in the templates content.

-> Bool

Should the output files be treated as a module. If it is a module it will create a directory with the name and put the files inside.

-> Maybe RelDir

Alternate output directory. Use to override config parameter

-> GenCommand 

GenCommand factory

genCommand :: Mod CommandFields Command #

initCommand :: Mod CommandFields Command #

versionOption :: Parser (a -> a) #

parserOptions :: ParserInfo Command #

This is the configuration given to Opt-Parser Applicative. This is what will be used in the cli program, the messages and banners displayed. It is a parser for GenCommand.