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>
Showing
- Cabal/Distribution/Simple/Setup.hs 7 additions, 0 deletionsCabal/Distribution/Simple/Setup.hs
- cabal-install/Distribution/Client/ProjectConfig/Legacy.hs 7 additions, 1 deletioncabal-install/Distribution/Client/ProjectConfig/Legacy.hs
- cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs 1 addition, 1 deletion...tall/tests/UnitTests/Distribution/Client/ProjectConfig.hs
Loading
Please register or sign in to comment