napkin-0.5.14
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageGHC2021

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
Show CliOptions # 
Instance details

Defined in Napkin.Spec.Cli

Eq 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

dumpDeps :: forall bk a. (MustacheBackend bk, RunBackendEffect bk, DumpBackendRequirements bk) => RuntimeEnv -> ExternMacros -> bk -> Spec bk a -> IO () #

specMain :: SpecBackend bk => 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 a. SpecBackend bk 
=> (AppConfig -> ResourceT IO (ComboEnv bk))

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 a. SpecBackend bk 
=> RuntimeEnv 
-> (AppConfig -> ResourceT IO (ComboEnv bk))

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) [SpecTableName] #

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

specListTags :: forall bk m. (SpecBackend bk, MonadIO m) => Specs bk -> m () #

Print the result of specTagRefMap'ing a particular spec to terminal.