From 0021634991f7355ea09536566153232d28835c8d Mon Sep 17 00:00:00 2001 From: Yong Studt <1240622744@qq.com> Date: Tue, 26 May 2026 13:49:57 +0800 Subject: [PATCH] =?UTF-8?q?docs(flags):=20=E8=AF=B4=E6=98=8E=E5=B8=83?= =?UTF-8?q?=E5=B0=94=E6=A0=87=E5=BF=97=E6=98=BE=E5=BC=8F=E5=8F=96=E5=80=BC?= =?UTF-8?q?=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 补充布尔标志不能用空格传递显式 false 的说明 - 指明需要使用 --flag=false 形式传入布尔值 --- docs/v3/examples/flags/basics.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/v3/examples/flags/basics.md b/docs/v3/examples/flags/basics.md index de2734f5a6..1995028bc0 100644 --- a/docs/v3/examples/flags/basics.md +++ b/docs/v3/examples/flags/basics.md @@ -78,6 +78,9 @@ $ greet --lang=spanish my-friend Hola my-friend ``` +Boolean flags are the exception: passing a boolean flag without a value sets it to +`true`. Use the `=` form, such as `--flag=false`, to provide an explicit boolean value. + While the value of any flag can be retrieved using ```command.``` sometimes it is convenient to have the value of the flag automatically stored in a destination variable for a flag. If the `Value` is set for the flag, it will be shown as default,