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

Function telemetryCommandPath

internal/ghcmd/cmd.go:295–301  ·  view source on GitHub ↗

telemetryCommandPath returns the path of the command that args resolve to when it is in refreshTelemetryCommands, and "other" for any other command, including extensions, aliases, and arguments that resolve to no command.

(rootCmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

293// telemetryCommandPath returns the path of the command that args resolve to when it is in refreshTelemetryCommands,
294// and "other" for any other command, including extensions, aliases, and arguments that resolve to no command.
295func telemetryCommandPath(rootCmd *cobra.Command, args []string) string {
296 c, _, err := rootCmd.Find(args)
297 if err == nil && c != nil && slices.Contains(refreshTelemetryCommands, c.CommandPath()) {
298 return c.CommandPath()
299 }
300 return "other"
301}
302
303// printError writes err to out, followed by usage information when the error
304// is the result of command misuse. When fullHelp is set the complete help text

Callers 2

MainFunction · 0.85

Calls 2

ContainsMethod · 0.80
FindMethod · 0.65

Tested by 1