commandHelp displays help and usage information for all Commands and Variables or a specific Command or Variable.
(args string, ui plugin.UI)
| 316 | // commandHelp displays help and usage information for all Commands |
| 317 | // and Variables or a specific Command or Variable. |
| 318 | func 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. |
| 345 | func newCompleter(fns []string) func(string) string { |
no test coverage detected
searching dependent graphs…