MCPcopy Create free account
hub / github.com/google/pprof / matchVariableOrCommand

Function matchVariableOrCommand

internal/driver/interactive.go:381–394  ·  view source on GitHub ↗

matchVariableOrCommand attempts to match a string token to the prefix of a Command.

(token string)

Source from the content-addressed store, hash-verified

379
380// matchVariableOrCommand attempts to match a string token to the prefix of a Command.
381func matchVariableOrCommand(token string) string {
382 token = strings.ToLower(token)
383 var matches []string
384 for cmd := range pprofCommands {
385 if strings.HasPrefix(cmd, token) {
386 matches = append(matches, cmd)
387 }
388 }
389 matches = append(matches, completeConfig(token)...)
390 if len(matches) == 1 {
391 return matches[0]
392 }
393 return ""
394}
395
396// functionCompleter replaces provided substring with a function
397// name retrieved from a profile if a single match exists. Otherwise,

Callers 1

newCompleterFunction · 0.85

Calls 1

completeConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…