aboutsummaryrefslogtreecommitdiffstats
path: root/src/Verismith/OptParser.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-05-13 01:15:44 +0100
committerYann Herklotz <git@yannherklotz.com>2020-05-13 01:15:44 +0100
commit501cac8b2eda9e68c200231bdabca17ac48264d7 (patch)
tree9be8adf9c93e430dcb1c0c6d3b39b0aa33a2ea15 /src/Verismith/OptParser.hs
parentd79412813c44767df06bce0d33f7472b30814a30 (diff)
parentd50a0b5b57aae1c7558fa77c362ae2e36038b63c (diff)
downloadverismith-501cac8b2eda9e68c200231bdabca17ac48264d7.tar.gz
verismith-501cac8b2eda9e68c200231bdabca17ac48264d7.zip
Merge branch 'master' into dev/reducerdev/reducer
Diffstat (limited to 'src/Verismith/OptParser.hs')
-rw-r--r--src/Verismith/OptParser.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Verismith/OptParser.hs b/src/Verismith/OptParser.hs
index 108cf01..c2b31fe 100644
--- a/src/Verismith/OptParser.hs
+++ b/src/Verismith/OptParser.hs
@@ -68,6 +68,10 @@ data Opts
configOptConfigFile :: !(Maybe FilePath),
configOptDoRandomise :: !Bool
}
+ | DistanceOpt
+ { distanceOptVerilogA :: !FilePath,
+ distanceOptVerilogB :: !FilePath
+ }
textOption :: Mod OptionFields String -> Parser Text
textOption = fmap T.pack . Opt.strOption
@@ -283,6 +287,18 @@ configOpts =
"Randomise the given default config, or the default config by randomly switchin on and off options."
)
+distanceOpts :: Parser Opts
+distanceOpts =
+ DistanceOpt
+ <$> ( fromText . T.pack
+ <$> Opt.strArgument
+ (Opt.metavar "FILE" <> Opt.help "First verilog file.")
+ )
+ <*> ( fromText . T.pack
+ <$> Opt.strArgument
+ (Opt.metavar "FILE" <> Opt.help "Second verilog file.")
+ )
+
argparse :: Parser Opts
argparse =
Opt.hsubparser
@@ -338,6 +354,17 @@ argparse =
)
<> Opt.metavar "config"
)
+ <|> Opt.hsubparser
+ ( Opt.command
+ "distance"
+ ( Opt.info
+ distanceOpts
+ ( Opt.progDesc
+ "Calculate the distance between two different pieces of Verilog."
+ )
+ )
+ <> Opt.metavar "distance"
+ )
version :: Parser (a -> a)
version =