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

Method Help

cmd/dagger/functions.go:265–286  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

263}
264
265func (fc *FuncCommand) Help(cmd *cobra.Command) error {
266 var args []any
267 // We need to store these in annotations because during traversal all
268 // sub-commands are created, not just the one selected. At the end of
269 // traversal we'll get the final command, but without the associated
270 // function or object type definitions.
271 if skipped, ok := cmd.Annotations[skippedOptsAnnotation]; ok {
272 args = append(args, "arguments", strings.Split(skipped, ", "))
273 }
274 if skipped, ok := cmd.Annotations[skippedCmdsAnnotation]; ok {
275 args = append(args, "functions", strings.Split(skipped, ", "))
276 }
277 if len(args) > 0 {
278 msg := "Skipped unsupported types"
279 if fc.warnSkipped {
280 slog.Warn(msg, args...)
281 } else {
282 slog.Debug(msg, args...)
283 }
284 }
285 return cmd.Help()
286}
287
288// execute runs the main logic for the top level command's RunE function.
289func (fc *FuncCommand) execute(c *cobra.Command, a []string) (rerr error) {

Callers 2

executeMethod · 0.95
RenderKeymapFunction · 0.45

Calls 2

WarnFunction · 0.92
DebugFunction · 0.92

Tested by

no test coverage detected