module Data.Text.Interp.CLI
( Input(..)
, opts
) where
import Data.Semigroup ((<>))
import Options.Applicative
import System.IO (FilePath)
data Input = Input {
substF :: FilePath
, interpF :: FilePath
}
input :: Parser Input
input = Input <$> (
(strOption $ long "substitutions"
<> help "JSON file containing map of substitutions")
<|>
(strArgument $ metavar "SUBST"
<> help "JSON file containing map of substitutions")
) <*> (
(strOption $ long "interpolations"
<> help "file containing text to interpolate")
<|>
(strArgument $ metavar "INTERP"
<> help "file containing text to interpolate"))
opts :: ParserInfo Input
opts = info (input <**> helper)
(fullDesc
<> progDesc "Randomly interpolate values into a template"
<> header "interp")