|
1 | 1 | {-# LANGUAGE NoImplicitPrelude #-} |
2 | 2 | {-# LANGUAGE OverloadedStrings #-} |
3 | 3 |
|
4 | | -module Stack.Options.BenchParser where |
| 4 | +module Stack.Options.BenchParser |
| 5 | + ( benchOptsParser |
| 6 | + ) where |
5 | 7 |
|
6 | 8 | import Options.Applicative |
7 | | -import Options.Applicative.Builder.Extra |
| 9 | + ( Parser, flag', help, long, metavar, strOption ) |
| 10 | +import Options.Applicative.Builder.Extra ( optionalFirst ) |
8 | 11 | import Stack.Prelude |
9 | | -import Stack.Options.Utils |
10 | | -import Stack.Types.Config |
| 12 | +import Stack.Options.Utils ( hideMods ) |
| 13 | +import Stack.Types.Config ( BenchmarkOptsMonoid (..) ) |
11 | 14 |
|
12 | 15 | -- | Parser for bench arguments. |
13 | 16 | -- FIXME hiding options |
14 | 17 | benchOptsParser :: Bool -> Parser BenchmarkOptsMonoid |
15 | 18 | benchOptsParser hide0 = BenchmarkOptsMonoid |
16 | | - <$> optionalFirst (strOption (long "benchmark-arguments" <> |
17 | | - long "ba" <> |
18 | | - metavar "BENCH_ARGS" <> |
19 | | - help ("Forward BENCH_ARGS to the benchmark suite. " <> |
20 | | - "Supports templates from `cabal bench`") <> |
21 | | - hide)) |
22 | | - <*> optionalFirst (flag' True (long "no-run-benchmarks" <> |
23 | | - help "Disable running of benchmarks. (Benchmarks will still be built.)" <> |
24 | | - hide)) |
25 | | - where hide = hideMods hide0 |
| 19 | + <$> optionalFirst (strOption |
| 20 | + ( long "benchmark-arguments" |
| 21 | + <> long "ba" |
| 22 | + <> metavar "BENCH_ARGS" |
| 23 | + <> help "Forward BENCH_ARGS to the benchmark suite. Supports templates \ |
| 24 | + \from `cabal bench`" |
| 25 | + <> hide |
| 26 | + )) |
| 27 | + <*> optionalFirst (flag' True |
| 28 | + ( long "no-run-benchmarks" |
| 29 | + <> help "Disable running of benchmarks. (Benchmarks will still be \ |
| 30 | + \built.)" |
| 31 | + <> hide |
| 32 | + )) |
| 33 | + where |
| 34 | + hide = hideMods hide0 |
0 commit comments