1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-22 06:11:36 +03:00
juvix/app/Commands/Dev/Options.hs

134 lines
3.3 KiB
Haskell
Raw Normal View History

2022-09-14 17:16:15 +03:00
module Commands.Dev.Options
( module Commands.Dev.Options,
2022-09-29 18:44:55 +03:00
module Commands.Dev.Asm.Options,
2022-09-14 17:16:15 +03:00
module Commands.Dev.Core.Options,
module Commands.Dev.Internal.Options,
module Commands.Dev.Parse.Options,
module Commands.Dev.Highlight.Options,
module Commands.Dev.Scope.Options,
module Commands.Dev.Doc.Options,
module Commands.Dev.Termination.Options,
)
where
2022-12-06 13:33:20 +03:00
import Commands.Dev.Asm.Options hiding (Compile)
2022-09-14 17:16:15 +03:00
import Commands.Dev.Core.Options
import Commands.Dev.Doc.Options
import Commands.Dev.Highlight.Options
import Commands.Dev.Internal.Options
import Commands.Dev.MiniC.Options
import Commands.Dev.Parse.Options
2022-11-03 11:38:09 +03:00
import Commands.Dev.Runtime.Options
2022-09-14 17:16:15 +03:00
import Commands.Dev.Scope.Options
import Commands.Dev.Termination.Options
import CommonOptions
data DevCommand
= DisplayRoot
| Highlight HighlightOptions
| Internal InternalCommand
| Core CoreCommand
2022-09-29 18:44:55 +03:00
| Asm AsmCommand
2022-11-03 11:38:09 +03:00
| Runtime RuntimeCommand
2022-09-14 17:16:15 +03:00
| MiniC MiniCOptions
| Parse ParseOptions
| Scope ScopeOptions
| Termination TerminationCommand
| Doc DocOptions
deriving stock (Data)
parseDevCommand :: Parser DevCommand
parseDevCommand =
hsubparser
( mconcat
[ commandHighlight,
commandInternal,
commandCore,
2022-09-29 18:44:55 +03:00
commandAsm,
2022-11-03 11:38:09 +03:00
commandRuntime,
2022-09-14 17:16:15 +03:00
commandMiniC,
commandParse,
commandDoc,
commandScope,
commandShowRoot,
commandTermination
]
)
commandDoc :: Mod CommandFields DevCommand
commandDoc =
command "doc" $
info
(Doc <$> parseDoc)
(progDesc "Generate documentation")
commandHighlight :: Mod CommandFields DevCommand
commandHighlight =
command "highlight" $
info
(Highlight <$> parseHighlight)
(progDesc "Highlight a Juvix file")
commandMiniC :: Mod CommandFields DevCommand
commandMiniC =
command "minic" $
info
(MiniC <$> parseMiniC)
(progDesc "Translate a Juvix file to MiniC")
commandInternal :: Mod CommandFields DevCommand
commandInternal =
command "internal" $
info
(Internal <$> parseInternalCommand)
(progDesc "Subcommands related to Internal")
commandCore :: Mod CommandFields DevCommand
commandCore =
command "core" $
info
(Core <$> parseCoreCommand)
(progDesc "Subcommands related to JuvixCore")
2022-09-29 18:44:55 +03:00
commandAsm :: Mod CommandFields DevCommand
commandAsm =
command "asm" $
info
(Asm <$> parseAsmCommand)
(progDesc "Subcommands related to JuvixAsm")
2022-11-03 11:38:09 +03:00
commandRuntime :: Mod CommandFields DevCommand
commandRuntime =
command "runtime" $
info
(Runtime <$> parseRuntimeCommand)
(progDesc "Subcommands related to the Juvix runtime")
2022-09-14 17:16:15 +03:00
commandParse :: Mod CommandFields DevCommand
commandParse =
command "parse" $
info
(Parse <$> parseParse)
(progDesc "Parse a Juvix file")
commandScope :: Mod CommandFields DevCommand
commandScope =
command "scope" $
info
(Scope <$> parseScope)
(progDesc "Parse and scope a Juvix file")
commandShowRoot :: Mod CommandFields DevCommand
commandShowRoot =
command "root" $
info
(pure DisplayRoot)
(progDesc "Show the root path for a Juvix project")
commandTermination :: Mod CommandFields DevCommand
commandTermination =
command "termination" $
info
(Termination <$> parseTerminationCommand)
(progDesc "Subcommands related to termination checking")