(t *modTypeDef)
| 426 | } |
| 427 | |
| 428 | func shellTypeDoc(t *modTypeDef) string { |
| 429 | var doc ShellDoc |
| 430 | |
| 431 | fp := t.AsFunctionProvider() |
| 432 | if fp == nil { |
| 433 | doc.Add(t.KindDisplay(), t.Long()) |
| 434 | |
| 435 | // If not an object, only have the type to show. |
| 436 | return doc.String() |
| 437 | } |
| 438 | |
| 439 | if fp.ProviderName() != "Query" { |
| 440 | doc.Add(t.KindDisplay(), t.Long()) |
| 441 | } |
| 442 | |
| 443 | if fns := fp.GetFunctions(); len(fns) > 0 { |
| 444 | doc.Add( |
| 445 | "Available Functions", |
| 446 | nameShortWrapped(fns, func(f *modFunction) (string, string) { |
| 447 | return f.CmdName(), f.Short() |
| 448 | }), |
| 449 | ) |
| 450 | doc.Add("", `Use ".help <function>" for more information on a function.`) |
| 451 | } |
| 452 | |
| 453 | return doc.String() |
| 454 | } |
| 455 | |
| 456 | // isHiddenFunction returns true for internal functions that are callable |
| 457 | // but should not clutter .help output: the synthetic "with" constructor |
no test coverage detected