askedForHelp reports whether args include a help flag. Commands that take no flags use it, since only a flag set returns flag.ErrHelp on its own.
(args []string)
| 188 | // askedForHelp reports whether args include a help flag. Commands that take no |
| 189 | // flags use it, since only a flag set returns flag.ErrHelp on its own. |
| 190 | func askedForHelp(args []string) bool { |
| 191 | return slices.ContainsFunc(args, func(a string) bool { |
| 192 | return a == "-h" || a == "-help" || a == "--help" |
| 193 | }) |
| 194 | } |
| 195 | |
| 196 | func main() { |
| 197 | os.Exit(runMain(os.Args[1:], os.Stdout, os.Stderr)) |
no outgoing calls
no test coverage detected