MCPcopy Index your code
hub / github.com/larksuite/cli / isCobraUsageError

Function isCobraUsageError

cmd/root.go:326–334  ·  view source on GitHub ↗

isCobraUsageError reports whether err is a cobra / pflag usage mistake, identified by the stable error text of the pinned cobra version.

(err error)

Source from the content-addressed store, hash-verified

324// isCobraUsageError reports whether err is a cobra / pflag usage mistake,
325// identified by the stable error text of the pinned cobra version.
326func isCobraUsageError(err error) bool {
327 msg := err.Error()
328 for _, m := range cobraUsageErrorMarkers {
329 if strings.Contains(msg, m) {
330 return true
331 }
332 }
333 return false
334}
335
336// installUnknownSubcommandGuard replaces cobra's silent help fallback on
337// group commands (no Run/RunE) with an unknown_subcommand error.

Callers 1

handleRootErrorFunction · 0.85

Calls 2

ErrorMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected