Skip to content

Commit 7bdbf39

Browse files
committed
add suggestions
1 parent 8b12b14 commit 7bdbf39

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

Cabal/src/Distribution/Simple/Setup/Config.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,12 @@ configureOptions showOrParseArgs =
572572
"optimization"
573573
configOptimization
574574
(\v flags -> flags{configOptimization = v})
575-
[ reqArg'
575+
[ optArg'
576576
"n"
577-
(Flag . fromString)
577+
(Flag . fromMaybe noFlagValue . fmap fromString)
578578
( \case
579579
NoFlag -> []
580-
Flag flag -> [O.toString flag]
580+
Flag flag -> [Just $ O.toString flag]
581581
)
582582
"O"
583583
["enable-optimization", "enable-optimisation"]
@@ -592,12 +592,12 @@ configureOptions showOrParseArgs =
592592
"debug-info"
593593
configDebugInfo
594594
(\v flags -> flags{configDebugInfo = v})
595-
[ reqArg'
595+
[ optArg'
596596
"n"
597-
(Flag . fromString)
597+
(Flag . fromMaybe noFlagValue . fmap fromString)
598598
( \case
599599
NoFlag -> []
600-
Flag flag -> [D.toString flag]
600+
Flag flag -> [Just $ D.toString flag]
601601
)
602602
"g"
603603
["enable-debug-info"]

changelog.d/11937.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ The rendering of certain boolean‑like flags has been changed to use numeric le
88
- For the `-O` (optimisation) flag, `True` or an unspecified value now renders as `1`, while `False` renders as `0`.
99
- For the `-g` (debug info) flag, `True` or an unspecified value now renders `2`, while `False` renders as `0`.
1010
This makes the displayed compiler flags more consistent with their internal semantics (e.g. optimisation level 1 is the default).
11-
- The `-g` flag is being repurposed to exclusively control debug information,
12-
aligning it with common build system conventions. Previously, `-g` served as
13-
an alias for `--ghc`. Please use the explicit `--ghc` flag instead.
11+
- Removes the short `-g` option for the `--ghc` flag. This is now used as the short option for `--enable-debug-info`.
12+
```diff
13+
$ cabal build --help
14+
...
15+
- -g, --ghc compile with GHC
16+
+ --ghc compile with GHC
17+
...
18+
- --enable-debug-info[=n] Emit debug info (n is 0--3, default is 0)
19+
+ -g n or -gn, --enable-debug-info[=n]
20+
+ Emit debug info (n is 0--3, default is 0)
21+
```

0 commit comments

Comments
 (0)