Newer
Older
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module Main where
import SimpleFormulaChecker (compareSpec)
import Data.Semigroup ((<>))
import Options.Applicative
import Control.Monad
-- | Command-line options.
data Options = Options
{ src :: String
, method1 :: String
, method2 :: String
}
-- | Parsing of command-line options.
parseOptions :: Parser Options
parseOptions = Options
<$> option auto
( long "src"
<> showDefault
<> value "examples/javawlp_edsl/src/nl/uu/javawlp_edsl/Main.java"
<> metavar "STRING"
<> help "Java source file"
)
<*> strOption
( short 'a'
<> metavar "STRING"
<> help "First method"
)
<*> strOption
( short 'b'
<> metavar "STRING"
<> help "Second method"
)
withInfo :: Parser a -> String -> ParserInfo a
withInfo opts desc = info (helper <*> opts) $ progDesc desc
-- | Main.
main :: IO ()
main = run =<< execParser (parseOptions `withInfo` "Java WLP")
-- | Run.
run :: Options -> IO ()
run (Options src method1 method2) = void $
compareSpec (src, method1) (src, method2)