Safe Haskell | Safe-Inferred |
---|
Command
Synopsis
- data Command
- data GenCommand = GenCommand {}
- data InitCommand = InitCommand
- data CommandError
- = InvalidSubstitutionError String
- | DuplicateSubstitutionError String
- mkInvalidOutputMapError :: [String] -> CommandError
- mkDuplicateOutputMapError :: (String, String) -> Map String String -> CommandError
- mkSubstitutions :: String -> Either String (Map String String)
- mkOptionalOutput :: String -> Either String (Maybe RelDir)
- mkGenCommand :: String -> String -> Map String String -> Bool -> Maybe RelDir -> GenCommand
- mkInitCommand :: InitCommand
- mkGenCommandParser :: Parser Command
- genCommand :: Mod CommandFields Command
- mkInitCommandParser :: Parser Command
- initCommand :: Mod CommandFields Command
- mkCommandParser :: Parser Command
- versionOption :: Parser (a -> a)
- parserOptions :: ParserInfo Command
Documentation
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
| |
Init |
data GenCommand #
Constructors
GenCommand | |
Fields
|
data InitCommand #
Constructors
InitCommand |
Instances
Show InitCommand # | |
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
Show CommandError # | |
Defined in Command Methods showsPrec :: Int -> CommandError -> ShowS show :: CommandError -> String showList :: [CommandError] -> ShowS |
mkInvalidOutputMapError :: [String] -> CommandError #
mkDuplicateOutputMapError :: (String, String) -> Map String String -> CommandError #
mkSubstitutions :: String -> Either String (Map String String) #
mkOptionalOutput :: String -> Either String (Maybe RelDir) #
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
mkGenCommandParser :: Parser Command #
genCommand :: Mod CommandFields Command #
mkInitCommandParser :: Parser Command #
initCommand :: Mod CommandFields Command #
mkCommandParser :: Parser 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.