From 666b603e380566b3faf684b385848e6d9fc63004 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 3 Oct 2025 00:54:20 +0200 Subject: Show 'correct' explicit bool value syntax in help --- printusage_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'printusage_test.go') diff --git a/printusage_test.go b/printusage_test.go index df982aa..076d13d 100644 --- a/printusage_test.go +++ b/printusage_test.go @@ -6,12 +6,12 @@ import ( "testing" ) -const expectedOutput = ` --long-form Some description - --long-form2 Some description - with multiline - -s, --long-name Some description - -t, --long-name2 Some description with - multiline +const expectedOutput = ` --long-form[=true|false] Some description + --long-form2[=true|false] Some description + with multiline + -s, --long-name[=true|false] Some description + -t, --long-name2[=true|false] Some description with + multiline ` func setUpPFlagSet(buf io.Writer) *FlagSet { @@ -47,11 +47,11 @@ func setUpPFlagSet2(buf io.Writer) *FlagSet { return f } -const expectedOutput2 = ` --long-form Some description - --long-form2 Some description +const expectedOutput2 = ` --long-form[=true|false] Some description + --long-form2[=true|false] Some description with multiline - -s, --long-name Some description - -t, --long-name2 Some description with + -s, --long-name[=true|false] Some description + -t, --long-name2[=true|false] Some description with multiline -o, --other-very-long-arg string Some very long description having break the limit (default @@ -69,6 +69,6 @@ func TestPrintUsage_2(t *testing.T) { f := setUpPFlagSet2(&buf) res := f.FlagUsagesWrapped(80) if res != expectedOutput2 { - t.Errorf("Expected \n%q \nActual \n%q", expectedOutput2, res) + t.Errorf("Expected \n%s \nActual \n%s", expectedOutput2, res) } } -- cgit v1.2.3