Merge pull request #18207 from dvdksn/fix-cli-default-values

fix: ignore empty default values for cli flags
This commit is contained in:
David Karlsson 2023-09-15 16:57:22 +02:00 committed by GitHub
commit d0134bcfb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -85,7 +85,12 @@
<tr>
<td>{{ with .option }}<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>
{{ with .min_api_version }}
{{ partial "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) }}