pflag icon indicating copy to clipboard operation
pflag copied to clipboard

StringSlice displays default even if "zeroed" DefValue

Open mkyc opened this issue 3 years ago • 0 comments

For multiline descriptions it looks very weird sometimes when (default ....) section is placed at the end of paragraph. There is simple workaround - zero DefValue like this (cobra example): fooCmd.Flags().Lookup("foo-flag").DefValue = "". In most cases it will work and prevent (default ...) part from being added at the end but it doesn't work for StringSlice flag type and there would be something like this generated in usage text:

usage text (default )

mkyc avatar May 14 '21 21:05 mkyc