aboutsummaryrefslogtreecommitdiffstats
path: root/src/Verismith.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-04-26 16:57:22 +0100
committerYann Herklotz <git@yannherklotz.com>2020-04-26 16:57:22 +0100
commit34aaba05bda3377a90e056b7b371cae82778a202 (patch)
tree6132e2294f61c9b9308152f3baa4e24eb7662a4c /src/Verismith.hs
parent0fb9d8a7097c45a7f522c428850bf88d738d576b (diff)
downloadverismith-34aaba05bda3377a90e056b7b371cae82778a202.tar.gz
verismith-34aaba05bda3377a90e056b7b371cae82778a202.zip
Add distance to commandline
Diffstat (limited to 'src/Verismith.hs')
-rw-r--r--src/Verismith.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Verismith.hs b/src/Verismith.hs
index c9d3e78..9dc3475 100644
--- a/src/Verismith.hs
+++ b/src/Verismith.hs
@@ -70,6 +70,7 @@ import Verismith.Tool
import Verismith.Tool.Internal
import Verismith.Verilog
import Verismith.Verilog.Parser (parseSourceInfoFile)
+import Verismith.Verilog.Distance
import Verismith.Utils (generateByteString)
toFP :: String -> FilePath
@@ -216,6 +217,11 @@ handleOpts (ConfigOpt c conf r) = do
$ T.unpack
. toTextIgnore
<$> c
+handleOpts (DistanceOpt v1 v2) = do
+ src1 <- parseSourceInfoFile (T.pack v1) (toTextIgnore v1)
+ src2 <- parseSourceInfoFile (T.pack v2) (toTextIgnore v2)
+ let d = distance src1 src2
+ putStrLn ("Distance: " <> show d)
defaultMain :: IO ()
defaultMain = do