allow saving the bench report to an arbitrary location
This commit is contained in:
parent
4a3882d90f
commit
d192379d3c
3 changed files with 40 additions and 2 deletions
31
agora-bench/Options.hs
Normal file
31
agora-bench/Options.hs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
module Options (Options (..), parseOptions) where
|
||||
|
||||
import Options.Applicative ((<**>))
|
||||
import Options.Applicative qualified as Opt
|
||||
|
||||
newtype Options = Options
|
||||
{ output :: FilePath
|
||||
}
|
||||
|
||||
outputOpt :: Opt.Parser 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."
|
||||
)
|
||||
|
||||
benchOpt :: Opt.Parser Options
|
||||
benchOpt = Options <$> outputOpt
|
||||
|
||||
parseOptions :: IO Options
|
||||
parseOptions = Opt.execParser p
|
||||
where
|
||||
p =
|
||||
Opt.info
|
||||
(benchOpt <**> Opt.helper)
|
||||
( Opt.fullDesc
|
||||
<> Opt.progDesc "Generate benchmark report of agora scripts"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue