criterion 1.2.3.0 → 1.2.4.0
raw patch · 3 files changed
+25/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Criterion/Main/Options.hs +19/−9
- changelog.md +4/−0
- criterion.cabal +2/−2
Criterion/Main/Options.hs view
@@ -100,16 +100,26 @@ -- ^ Default configuration to use if options are not -- explicitly specified. -> Parser Mode-parseWith cfg =- (matchNames (Run <$> config cfg)) <|>- runIters <|>- (List <$ switch (long "list" <> short 'l' <> help "List benchmarks")) <|>- (Version <$ switch (long "version" <> help "Show version info"))+parseWith cfg = config cfg <**> runMode+ -- Important: only run `config` once here, as we only want the+ -- command-line options resulting from `config` to appear once+ -- in the `--help` output. See #168. where- runIters = matchNames $- RunIters <$> config cfg <*> option auto- (long "iters" <> short 'n' <> metavar "ITERS" <>- help "Run benchmarks, don't analyse")+ runMode :: Parser (Config -> Mode)+ runMode =+ matchNames (pure $ \mt bs cfg' -> Run cfg' mt bs) <|>+ runIters <|>+ (const List <$ switch (long "list" <> short 'l' <> help "List benchmarks")) <|>+ (const Version <$ switch (long "version" <> help "Show version info"))++ runIters :: Parser (Config -> Mode)+ runIters = matchNames $ (\iters mt bs cfg' -> RunIters cfg' iters mt bs)+ <$> option auto+ (long "iters" <> short 'n' <> metavar "ITERS" <>+ help "Run benchmarks, don't analyse")++ matchNames :: Parser (MatchType -> [String] -> Config -> Mode)+ -> Parser (Config -> Mode) matchNames wat = wat <*> option match (long "match" <> short 'm' <> metavar "MATCH" <> value Prefix <>
changelog.md view
@@ -1,3 +1,7 @@+1.2.4.0++* Fix issue where `--help` would display duplicate options+ 1.2.3.0 * Add a `Semigroup` instance for `Outliers`
criterion.cabal view
@@ -1,5 +1,5 @@ name: criterion-version: 1.2.3.0+version: 1.2.4.0 synopsis: Robust, reliable performance measurement and analysis license: BSD3 license-file: LICENSE@@ -23,7 +23,7 @@ GHC==7.8.4, GHC==7.10.3, GHC==8.0.2,- GHC==8.2.1+ GHC==8.2.2 data-files: templates/*.css