diff options
| author | LLLL Colonq <llll@colonq> | 2025-10-05 01:02:31 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-10-05 01:02:31 -0400 |
| commit | 874be6e6a13b89a87012af9d295d864632ad7cd6 (patch) | |
| tree | 23541e4bfe53e7aece8c1db25df9dca0d7d59fd0 /fig-cli/src/Fig | |
| parent | 0b086e7ea098317d13ca65b1384b0c0c974a2795 (diff) | |
Add fig-cli
Diffstat (limited to 'fig-cli/src/Fig')
| -rw-r--r-- | fig-cli/src/Fig/CLI.hs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fig-cli/src/Fig/CLI.hs b/fig-cli/src/Fig/CLI.hs new file mode 100644 index 0000000..36df60d --- /dev/null +++ b/fig-cli/src/Fig/CLI.hs @@ -0,0 +1,27 @@ +{-# Language ApplicativeDo #-} + +module Fig.CLI where + +import Fig.Prelude + +import Options.Applicative + +import Fig.Utils.SExpr + +newtype Opts = Opts + { sexpr :: Text + } + +parseOpts :: Parser Opts +parseOpts = do + sexpr <- strArgument (metavar "SEXPR" <> help "S-expression to parse") + pure Opts{..} + +main :: IO () +main = do + opts <- execParser $ info (parseOpts <**> helper) + ( fullDesc + <> Options.Applicative.header "fig-cli - assorted tools" + ) + let sexp = parseSExpr opts.sexpr + log $ tshow (sexp, pretty <$> sexp) |
