@@ -80,6 +80,7 @@ func Echo() *cobra.Command {
80
80
echoCmd .PersistentFlags ().BoolP ("persistentbool" , "p" , false , "help message for flag persistentbool" )
81
81
echoCmd .Flags ().IntP ("intone" , "i" , 123 , "help message for flag intone" )
82
82
echoCmd .Flags ().BoolP ("boolone" , "b" , true , "help message for flag boolone" )
83
+ echoCmd .Flags ().StringToStringP ("stringtostring" , "x" , nil , "help message for flag stringtostring" )
83
84
84
85
timesCmd := & cobra.Command {
85
86
Use : "times [# times] [string to echo]" ,
@@ -139,6 +140,9 @@ func TestGenDocs(t *testing.T) {
139
140
checkStringOmits (t , output , Root ().Short )
140
141
checkStringContains (t , output , EchoSubCmd ().Short )
141
142
checkStringOmits (t , output , deprecatedCmd .Short )
143
+
144
+ // Verify that the text "This value defaults to" is not printed when the default value is provided to StringToStringP
145
+ checkStringContains (t , output , "* - -x, --stringtostring\n - stringToString\n - false\n - help message for flag stringtostring\n *" )
142
146
}
143
147
144
148
func TestGenDocsNoHiddenParents (t * testing.T ) {
0 commit comments