From acda69972507fe690defd24d7d9851810555f35c Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Thu, 5 Oct 2017 16:02:49 -0700 Subject: [PATCH] Don't print defaults from the YAML in cases where the meaning is really 'default to unset' (#4813) --- _includes/cli.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_includes/cli.md b/_includes/cli.md index 4b501eee14..e9d6e5c943 100644 --- a/_includes/cli.md +++ b/_includes/cli.md @@ -65,10 +65,11 @@ your client and daemon API versions. {% capture min-api %}{% if option.min_api_version %}API {{ option.min_api_version }}+ {% endif %}{%endcapture%} {% capture stability-string %}{% if option.deprecated and option.experimental %}deprecated experimental {% elsif option.deprecated %}deprecated {% elsif option.experimental %}experimental {% endif %}{% endcapture %} {% capture all-badges %}{% unless min-api == '' and stability-string == '' %}{{ min-api }}{{ stability-string }}
{% endunless %}{% endcapture %} - + {% assign defaults-to-skip = "[],map[],false,0,0s,default,'',\"\"" | split: ',' %} + {% capture option-default %}{% if option.default_value %}{% unless defaults-to-skip contains option.default_value or defaults-to-skip == blank %}`{{ option.default_value }}`{% endunless %}{% endif %}{% endcapture %} `--{{ option.option }}{% if option.shorthand %} , -{{ option.shorthand }}{% endif %}` - {% if option.default_value and option.default_value != "[]" %}`{{ option.default_value }}`{% endif %} + {{ option-default }} {{ all-badges | strip }}{{ option.description | strip }}