napkin-0.5.9
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Napkin.Spec.Cli

Description

Napkin Command Line Interface, CLI

Synopsis

Documentation

data CliOptions #

Data structure for all CLI commnad and sub-commands.

SubCommand data strucres are Run, Dump, ListTags, DumpDeps Each SubCommands data strucures contain the available commands

Instances

Instances details
Eq CliOptions # 
Instance details

Defined in Napkin.Spec.Cli

Show CliOptions # 
Instance details

Defined in Napkin.Spec.Cli

newtype CustomSpecPreprocessor bk #

User-specified function to preprocess all specs. Useful for renaming all tables, for example, in development vs. production mode.

Constructors

CustomSpecPreprocessor (SpecMetaArgs -> SpecRuntime bk -> Specs bk -> Specs bk) 

Instances

Instances details
Default (CustomSpecPreprocessor bk) # 
Instance details

Defined in Napkin.Spec.Cli

parseRunOptions :: Parser CliOptions #

Parser for the run CLI sub-command

Parses available commands for the run sub-command and provides detail CLI help text

parseDumpOptions :: Parser CliOptions #

Parser for the dump CLI sub-command Parses available commands for the run sub-command and provides detail CLI help text

compileSpecs :: MonadIO m => [(t, Spec b a)] -> m [(t, Specs b)] #

Compile given list of specs into ready to execute form.

specMain :: SpecBackend bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9 => bk -> SpecRuntime bk -> Spec bk a -> IO ExitCode #

Use this to make your main entry point for your spec running application. specMain :: bk -> [(NS.SpecRuntime bk, NST.Spec bk ())] -> IO ()

specMainWith #

Arguments

:: forall bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9 a. SpecBackend bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9 
=> (AppConfig -> ResourceT IO ComboEnv)

How to build the combo. register any cleanup

-> CliOptions 
-> bk 
-> CustomSpecPreprocessor bk 
-> CustomValidator 
-> ExternMacros 
-> SpecRuntime bk 
-> Spec bk a 
-> IO ExitCode 

A more customizable specMain for embedding in larger programs. This API is unstable

specMainWithInterpreter #

Arguments

:: forall bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9 a. SpecBackend bk drop t1 t2 t3 t4 t5 t6 t7 t8 t9 
=> RuntimeEnv 
-> (AppConfig -> ResourceT IO ComboEnv)

How to build the combo. register any cleanup

-> CliOptions 
-> bk 
-> CustomSpecPreprocessor bk 
-> CustomValidator 
-> ExternMacros 
-> SpecRuntime bk 
-> Spec bk a 
-> IO ExitCode 

specTagRefMap :: [TableSpec b] -> Map (Maybe TableSpecTag) [Ref Table] #

create a mapping of TableSpecTags to `Ref Table`s for dumping.