From d8c4f4f35380597cb0ead5f7958c55f187e0417b Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Fri, 15 Sep 2023 16:19:10 +0200 Subject: [PATCH] fix: ignore empty default values for cli flags Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- layouts/_default/cli.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/_default/cli.html b/layouts/_default/cli.html index d7dc614d10..e9e4fbc8e1 100644 --- a/layouts/_default/cli.html +++ b/layouts/_default/cli.html @@ -85,7 +85,12 @@ {{ with .option }}--{{ . }}{{ end }} {{ with .shorthand }}-{{ . }}{{ end }} - {{ with .default_value }}{{ . }}{{ end }} + {{ $skipDefault := `[],map[],false,0,0s,default,'',""` }} + + {{ with .default_value }} + {{ cond (in $skipDefault .) "" (printf "%s" . | safeHTML) }} + {{ end }} + {{ with .min_api_version }} {{ partial "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) }}