MCPcopy Index your code
hub / github.com/devspace-sh/devspace / NewSpecificRunCommand

Function NewSpecificRunCommand

cmd/run.go:348–372  ·  view source on GitHub ↗

NewSpecificRunCommand creates a new run command

(command *latest.CommandConfig)

Source from the content-addressed store, hash-verified

346
347// NewSpecificRunCommand creates a new run command
348func NewSpecificRunCommand(command *latest.CommandConfig) *cobra.Command {
349 description := command.Description
350 longDescription := command.Description
351 if description == "" {
352 description = "Runs command: " + command.Name
353 longDescription = description
354 }
355 if len(description) > 64 {
356 if len(description) > 64 {
357 description = description[:61] + "..."
358 }
359 }
360
361 runCmd := &cobra.Command{
362 Use: command.Name,
363 Short: description,
364 Long: longDescription,
365 Args: cobra.ArbitraryArgs,
366 RunE: func(cobraCmd *cobra.Command, originalArgs []string) error {
367 return cobraCmd.Parent().RunE(cobraCmd, originalArgs)
368 },
369 }
370 runCmd.DisableFlagParsing = true
371 return runCmd
372}

Callers 1

NewRunCmdFunction · 0.85

Calls 1

ParentMethod · 0.65

Tested by

no test coverage detected