WriteHelp function will auto wrap and align the description that longer than terminal's width.
When multi-byte character in the description, like emoji or Chinese, the wrapping will be wrong.
func main() {
var opt struct {
WorkerId uint64 `short:"w" long:"worker" description:"01234567891123456789212345678931234567894123456789512345678961❤3456789"`
}
p := flags.NewParser(&opt, flags.HelpFlag|flags.PrintErrors)
p.WriteHelp(os.Stdout)
}
Output:
Usage:
example [OPTIONS]
Application Options:
-w, --worker= 01234567891123456789212345678931234567894123456789512345678961�-
��3456789
WriteHelp
function will auto wrap and align the description that longer than terminal's width. When multi-byte character in the description, like emoji or Chinese, the wrapping will be wrong.Output: