Skip to content
Snippets Groups Projects
Commit a3877791 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

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: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent df53e50e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment