Commit a387779
committed
Fix for-hackage rendering to distinguish NoFlag and default case.
This commit fixes one instances of a general bug where noFlag
command line flags do not translate correctly when converted
into the field description format (and in fact, cannot be
converted correctly.)
The bug goes something like this:
1. A noArg command line parser translates into a "choice"
command line parser, for which there is only one choice
(the flag that would be set when you toggle it on.)
2. Choice command line parsers get translated into the field
format by having a rendering for each defined choice,
and then default to empty (omit the field entirely) if
no choices apply.
3. This means that NoFlag and the "default choice" (if you
hadn't specified the flag at all) render identically,
because there is never a choice for the default choice
in the no arg field.
In the interest of getting this to work, I manually made
for-hackage work correctly, but there is probably a way to
refactor this into a more universal fix.
CC @dcoutts
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>1 parent df53e50 commit a387779
File tree
3 files changed
+15
-2
lines changed- Cabal/Distribution/Simple
- cabal-install
- Distribution/Client/ProjectConfig
- tests/UnitTests/Distribution/Client
3 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
1483 | 1490 | | |
1484 | 1491 | | |
1485 | 1492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
956 | 962 | | |
957 | 963 | | |
958 | 964 | | |
959 | 965 | | |
960 | 966 | | |
961 | | - | |
| 967 | + | |
962 | 968 | | |
963 | 969 | | |
964 | 970 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| |||
0 commit comments