File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
leios-trace-verifier/hs-src Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1+ {-# LANGUAGE OverloadedStrings #-}
2+ {-# LANGUAGE RecordWildCards #-}
3+
14module Main where
25
36import Data.ByteString.Lazy as BSL
47import LeiosEvents
58import Lib
6-
7- logFile :: FilePath
8- logFile = " leios-trace.log"
9+ import Options.Applicative
910
1011main :: IO ()
11- main = BSL. readFile logFile >>= print . verifyTrace . decodeJSONL
12+ main =
13+ do
14+ Command {.. } <- execParser commandParser
15+ BSL. readFile logFile >>= print . verifyTrace . decodeJSONL
16+
17+ newtype Command = Command
18+ { logFile :: FilePath
19+ }
20+ deriving (Eq , Ord , Read , Show )
21+
22+ commandParser :: ParserInfo Command
23+ commandParser =
24+ info (com <**> helper) $
25+ fullDesc
26+ <> progDesc " Short Leios trace verifier"
27+ <> header " parser - a Short Leios trace verifier"
28+ where
29+ com =
30+ Command
31+ <$> strOption
32+ ( long " trace-file"
33+ <> help " Short Leios simulation trace log file"
34+ )
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ executable parser
3636 , bytestring
3737 , leios-trace-hs
3838 , trace-parser
39+ , optparse-applicative
3940
4041 default-language : Haskell2010
4142 ghc-options : -Wall
You can’t perform that action at this time.
0 commit comments