The help message is formatted incorrectly when any of the options have an empty description.
Repro steps
Create a subcommand with empty argument descriptions. Then run the program and print the help message.
type KanjiArgs =
| Strokes of int
| Min_Strokes of int
| Max_Strokes of int
| Include_Stroke_Miscounts
| Radicals of string
| Skip_Code of string
| Sh_Code of string
| Four_Corner_Code of string
| Deroo_Code of string
| Reading of string
| Nanori of string
| Common_Only
| Pattern of string
interface IArgParserTemplate with
member this.Usage =
match this with
| Strokes _ -> ""
| Min_Strokes _ -> ""
| Max_Strokes _ -> ""
| Include_Stroke_Miscounts -> ""
| Radicals _ -> ""
| Skip_Code _ -> ""
| Sh_Code _ -> ""
| Four_Corner_Code _ -> ""
| Deroo_Code _ -> ""
| Reading _ -> ""
| Nanori _ -> ""
| Common_Only -> ""
| Pattern _ -> ""
type Args =
| [<CliPrefix(CliPrefix.None)>] Kanji of ParseResults<KanjiArgs>
interface IArgParserTemplate with
member this.Usage =
match this with
| Kanji _ -> ""
Expected behavior
The help message should be formatted with newlines between the options, like this.
Using a single space instead of an empty string for the description causes newlines to be added, but there are gaps between some of the options. Here is an example using x instead of a space for visibility.
USAGE: kensaku kanji [--help] [--strokes <int>] [--min-strokes <int>]
[--max-strokes <int>] [--include-stroke-miscounts]
[--radicals <string>] [--skip-code <string>]
[--sh-code <string>] [--four-corner-code <string>]
[--deroo-code <string>] [--reading <string>]
[--nanori <string>] [--common-only] [--pattern <string>]
OPTIONS:
--strokes <int> x
--min-strokes <int> x
--max-strokes <int> x
--include-stroke-miscounts
x
--radicals <string> x
--skip-code <string> x
--sh-code <string> x
--four-corner-code <string>
x
--deroo-code <string> x
--reading <string> x
--nanori <string> This is a very long description which needs to be
wrapped to multiple lines in order to fit
--common-only x
--pattern <string> x
--help display this list of options.
Description
The help message is formatted incorrectly when any of the options have an empty description.
Repro steps
Create a subcommand with empty argument descriptions. Then run the program and print the help message.
Expected behavior
The help message should be formatted with newlines between the options, like this.
Actual behavior
Instead the output looks like this.
Known workarounds
Using a single space instead of an empty string for the description causes newlines to be added, but there are gaps between some of the options. Here is an example using
x
instead of a space for visibility.Related information