Commit 74f1dc8
authored
Fix garbage text in markdown help heading for template-expanded options (#10096)
Fixes #10084
The markdown help output (`slangc -help-style markdown -h`) listed all
expanded names in `###` headings for template-expanded options. For
`-<compiler>-path`, this produced a heading with 14 compiler-specific
names (`-none-path, -fxc-path, -dxc-path, ...`), rendering as unreadable
garbage in the Downstream section of the docs. The same issue affected
`-fvk-<vulkan-shift>-shift` with 4 expanded names.
The text writer already handles this correctly by using the usage string
instead of the expanded names. The markdown writer had no way to
distinguish template-expanded names from regular aliases (e.g. `-h,
-help, --help`).
This adds a `displayName` field to `CommandOptions::Option` that
separates the display heading from the lookup names. Template-expanded
options set `displayName` to the template form (e.g.
`-<compiler>-path`), while alias options leave it empty and continue to
list all names in the heading. The markdown writer uses `displayName`
when set, and falls back to listing all names otherwise.1 parent db7cd04 commit 74f1dc8
File tree
5 files changed
+29
-10
lines changed- docs
- source
- core
- slang
5 files changed
+29
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
| 624 | + | |
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
356 | 363 | | |
357 | 364 | | |
358 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | | - | |
| 123 | + | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
698 | 703 | | |
699 | 704 | | |
700 | 705 | | |
701 | | - | |
| 706 | + | |
| 707 | + | |
702 | 708 | | |
703 | 709 | | |
704 | 710 | | |
| |||
803 | 809 | | |
804 | 810 | | |
805 | 811 | | |
806 | | - | |
| 812 | + | |
| 813 | + | |
807 | 814 | | |
808 | 815 | | |
809 | 816 | | |
| |||
0 commit comments