示例#1
0
// Stringifies the flag and returns the first line.
func shortFlag(flag cli.Flag) string {
	ss := strings.Split(flag.String(), "\n")
	if len(ss) == 0 {
		return ""
	}
	return ss[0]
}
示例#2
0
func longName(f cli.Flag) string {
	parts := strings.Split(f.String(), ",")
	return strings.TrimLeft(parts[0], "-")
}