MCPcopy Create free account
hub / github.com/cli/cli / askedForHelp

Function askedForHelp

script/ghmock/main.go:190–194  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
190func askedForHelp(args []string) bool {
191 return slices.ContainsFunc(args, func(a string) bool {
192 return a == "-h" || a == "-help" || a == "--help"
193 })
194}
195
196func main() {
197 os.Exit(runMain(os.Args[1:], os.Stdout, os.Stderr))

Callers 2

cmdSchemasFunction · 0.85
cmdResetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected