pipe benchmark result to diff directly

This commit is contained in:
Hongrui Fang 2022-08-05 17:51:58 +08:00
parent 5fb5518c07
commit 030b96b4a4
3 changed files with 26 additions and 23 deletions

View file

@ -1,21 +1,22 @@
module Options (Options (..), parseOptions) where
import Control.Applicative (optional)
import Options.Applicative ((<**>))
import Options.Applicative qualified as Opt
newtype Options = Options
{ output :: FilePath
{ output :: Maybe FilePath
}
outputOpt :: Opt.Parser FilePath
outputOpt :: Opt.Parser (Maybe FilePath)
outputOpt =
Opt.strOption
( Opt.long "output-path"
<> Opt.short 'o'
<> Opt.metavar "OUTPUT_PATH"
<> Opt.value "./bench.csv"
<> Opt.help "The path of the bench report file."
)
optional $
Opt.strOption
( Opt.long "output-path"
<> Opt.short 'o'
<> Opt.metavar "OUTPUT_PATH"
<> Opt.help "The path of the bench report file."
)
benchOpt :: Opt.Parser Options
benchOpt = Options <$> outputOpt