1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-28 18:11:49 +03:00
juvix/app/Commands/Dev/Repl/Options.hs
Łukasz Czajka 8956e51b33
Options for juvix dev tree read (#2599)
* Adds the `--transforms`, `--eval` and `--no-print` options to the
`juvix dev tree read` command.
* Depends on #2598 
* Depends on #2597 
* Depends on #2596 
* Depends on #2595 
* Depends on #2594 
* Depends on #2590
2024-01-31 15:17:14 +01:00

30 lines
809 B
Haskell

module Commands.Dev.Repl.Options where
import Commands.Repl.Options
import CommonOptions
import Juvix.Compiler.Core.Data.TransformationId (toStoredTransformations)
parseDevRepl :: Parser ReplOptions
parseDevRepl = do
let _replPrintValues = False
_replIsDev = True
_replInputFile <- optional (parseInputFile FileExtJuvix)
_replTransformations <- do
ts <- optCoreTransformationIds
pure $
if
| null ts -> toStoredTransformations
| otherwise -> ts
_replNoDisambiguate <- optNoDisambiguate
_replShowDeBruijn <-
switch
( long "show-de-bruijn"
<> help "Show variable de Bruijn indices"
)
_replNoPrelude <-
switch
( long "no-prelude"
<> help "Do not load the Prelude module on launch"
)
pure ReplOptions {..}