fix: ignore empty default values for cli flags

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2023-09-15 16:19:10 +02:00
parent 47ede73397
commit d8c4f4f353
1 changed files with 6 additions and 1 deletions

View File

@ -85,7 +85,12 @@
<tr> <tr>
<td>{{ with .option }}<code>--{{ . }}</code>{{ end }}</td> <td>{{ with .option }}<code>--{{ . }}</code>{{ end }}</td>
<td>{{ with .shorthand }}<code>-{{ . }}</code>{{ end }}</td> <td>{{ with .shorthand }}<code>-{{ . }}</code>{{ end }}</td>
<td>{{ with .default_value }}<code>{{ . }}</code>{{ end }}</td> {{ $skipDefault := `[],map[],false,0,0s,default,'',""` }}
<td>
{{ with .default_value }}
{{ cond (in $skipDefault .) "" (printf "<code>%s</code>" . | safeHTML) }}
{{ end }}
</td>
<td> <td>
{{ with .min_api_version }} {{ with .min_api_version }}
{{ partial "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) }} {{ partial "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) }}