MCPcopy
hub / github.com/dagger/dagger / TypesHelp

Method TypesHelp

cmd/dagger/shell_help.go:160–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158}
159
160func (h *shellCallHandler) TypesHelp() string {
161 var doc ShellDoc
162
163 var core []functionProvider
164 var mod []functionProvider
165
166 def := h.GetDef(nil)
167
168 for _, o := range def.AsFunctionProviders() {
169 if o.IsCore() {
170 core = append(core, o)
171 } else {
172 mod = append(mod, o)
173 }
174 }
175
176 doc.Add(
177 "Core Types",
178 nameShortWrapped(core, func(o functionProvider) (string, string) {
179 return o.ProviderName(), o.Short()
180 }),
181 )
182
183 if len(mod) > 0 && def.HasModule() {
184 doc.Add(
185 def.Name+" Types",
186 nameShortWrapped(mod, func(o functionProvider) (string, string) {
187 return o.ProviderName(), o.Short()
188 }),
189 )
190 }
191
192 doc.Add("", `Use ".help <type>" for more information on a type.`)
193
194 return doc.String()
195}
196
197type ShellDoc struct {
198 Groups []ShellDocSection

Callers 1

registerCommandsMethod · 0.95

Calls 9

GetDefMethod · 0.95
AddMethod · 0.95
StringMethod · 0.95
nameShortWrappedFunction · 0.85
AsFunctionProvidersMethod · 0.80
HasModuleMethod · 0.80
IsCoreMethod · 0.65
ProviderNameMethod · 0.65
ShortMethod · 0.65

Tested by

no test coverage detected