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

Function commandHelp

internal/driver/interactive.go:318–342  ·  view source on GitHub ↗

commandHelp displays help and usage information for all Commands and Variables or a specific Command or Variable.

(args string, ui plugin.UI)

Source from the content-addressed store, hash-verified

316// commandHelp displays help and usage information for all Commands
317// and Variables or a specific Command or Variable.
318func commandHelp(args string, ui plugin.UI) {
319 if args == "" {
320 help := usage(false)
321 help = help + `
322 : Clear focus/ignore/hide/tagfocus/tagignore
323
324 type "help <cmd|option>" for more information
325`
326
327 ui.Print(help)
328 return
329 }
330
331 if c := pprofCommands[args]; c != nil {
332 ui.Print(c.help(args))
333 return
334 }
335
336 if help, ok := configHelp[args]; ok {
337 ui.Print(help + "\n")
338 return
339 }
340
341 ui.PrintErr("Unknown command: " + args)
342}
343
344// newCompleter creates an autocompletion function for a set of commands.
345func newCompleter(fns []string) func(string) string {

Callers 1

interactiveFunction · 0.85

Calls 4

usageFunction · 0.85
helpMethod · 0.80
PrintMethod · 0.65
PrintErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…