Add --source-dir to CLI

This commit is contained in:
Christian Rasmussen 2020-06-19 11:49:37 +02:00
parent 67cdbd3ce4
commit 21a1245c10
2 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,8 @@ data CLOpt
SetCG String |
||| Don't implicitly import Prelude
NoPrelude |
||| Set source directory
SourceDir String |
||| Set build directory
BuildDir String |
||| Set output directory
@ -153,6 +155,8 @@ options = [MkOpt ["--check", "-c"] [] [CheckOnly]
(Just $ "Set code generator " ++ showDefault (codegen defaultSession)),
MkOpt ["--package", "-p"] [Required "package"] (\f => [PkgPath f])
(Just "Add a package as a dependency"),
MkOpt ["--source-dir"] [Required "dir"] (\d => [SourceDir d])
(Just $ "Set source directory"),
MkOpt ["--build-dir"] [Required "dir"] (\d => [BuildDir d])
(Just $ "Set build directory"),
MkOpt ["--output-dir"] [Required "dir"] (\d => [OutputDir d])

View File

@ -74,6 +74,9 @@ preOptions (SetCG e :: opts)
preOptions (PkgPath p :: opts)
= do addPkgDir p
preOptions opts
preOptions (SourceDir d :: opts)
= do setSourceDir (Just d)
preOptions opts
preOptions (BuildDir d :: opts)
= do setBuildDir d
preOptions opts