MCPcopy Create free account
hub / github.com/dagger/dagger / FunctionsList

Method FunctionsList

cmd/dagger/shell_help.go:15–35  ·  view source on GitHub ↗
(name string, fns []*modFunction)

Source from the content-addressed store, hash-verified

13)
14
15func (h *shellCallHandler) FunctionsList(name string, fns []*modFunction) string {
16 if len(fns) == 0 {
17 return ""
18 }
19
20 sb := new(strings.Builder)
21
22 sb.WriteString("Available functions:\n")
23 for _, f := range fns {
24 sb.WriteString(" - ")
25 sb.WriteString(f.CmdName())
26 sb.WriteString("\n")
27 }
28
29 usage := name + " | .help"
30
31 fmt.Fprintf(sb, "\nUse %q for more details.", usage)
32 fmt.Fprintf(sb, "\nUse %q for more information on a function.\n", usage+" <function>")
33
34 return sb.String()
35}
36
37func (h *shellCallHandler) CommandsList(name string, cmds []*ShellCommand) string {
38 if len(cmds) == 0 {

Callers

nothing calls this directly

Calls 2

CmdNameMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected