cli: don't render options table if only hidden options

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-02-29 15:13:29 +01:00
parent 98b3164e57
commit c04c83ff58
1 changed files with 60 additions and 57 deletions

View File

@ -94,6 +94,8 @@
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
{{ with $data.options }}
{{ $opts := where . "hidden" false }}
{{ with $opts }}
{{ $heading := dict "level" 2 "text" "Options" }}
{{ partial "heading.html" $heading }}
{{ $.Scratch.Add "headings" $heading }}
@ -106,7 +108,7 @@
</tr>
</thead>
<tbody>
{{ range where . "hidden" false }}
{{ range . }}
<tr>
{{ $short := .shorthand }}
{{ $long := .option }}
@ -154,6 +156,7 @@
</tbody>
</table>
{{ end }}
{{ end }}
{{ with $data.examples }}
{{ $heading := dict "level" 2 "text" "Examples" }}
{{ partial "heading.html" $heading }}