1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 18:13:56 +03:00
juvix/app/Commands/Dev/Asm/Options.hs
2022-09-29 17:44:55 +02:00

37 lines
903 B
Haskell

module Commands.Dev.Asm.Options where
import Commands.Dev.Asm.Run.Options
import Commands.Dev.Asm.Validate.Options
import CommonOptions
data AsmCommand
= Run AsmRunOptions
| Validate AsmValidateOptions
deriving stock (Data)
parseAsmCommand :: Parser AsmCommand
parseAsmCommand =
hsubparser $
mconcat
[ commandRun,
commandValidate
]
where
commandRun :: Mod CommandFields AsmCommand
commandRun = command "run" runInfo
commandValidate :: Mod CommandFields AsmCommand
commandValidate = command "validate" validateInfo
runInfo :: ParserInfo AsmCommand
runInfo =
info
(Run <$> parseAsmRunOptions)
(progDesc "Run a JuvixAsm file and pretty print the result")
validateInfo :: ParserInfo AsmCommand
validateInfo =
info
(Validate <$> parseAsmValidateOptions)
(progDesc "Validate a JuvixAsm file")