forked from HDSpray/Kuifje
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.hs
26 lines (23 loc) · 752 Bytes
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Main where
import Control.Applicative (empty)
import Control.Monad (when)
import Data.List (isPrefixOf)
import System.Environment
import Kuifje.Run
main :: IO ()
main =
do
args <- getArgs
case args of
[] ->
putStrLn "please provide a file"
(mode : file : flags) | not . isPrefixOf "-" $ file ->
case mode of
"run" -> runFileDefaultParams file flags
"ldists" | (invar:svals:_) <- flags ->
leakDists file invar svals
| otherwise ->
putStrLn "ldists requires an input var and a list of input values"
_ -> putStrLn "provided an unknown compiler mode"
(file : flags) ->
runFileDefaultParams file flags