MCPcopy Index your code
hub / github.com/ddev/ddev / init

Function init

cmd/ddev/cmd/exec.go:128–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126}
127
128func init() {
129 DdevExecCmd.Flags().StringVarP(&serviceType, "service", "s", "web", "Define the service to connect to. [e.g. web, db]")
130 _ = DdevExecCmd.RegisterFlagCompletionFunc("service", ddevapp.GetServiceNamesFunc(true))
131 DdevExecCmd.Flags().StringVarP(&execDirArg, "dir", "d", "", "Define the execution directory within the container")
132 DdevExecCmd.Flags().Bool("raw", true, "Use raw exec (do not interpret with Bash inside container)")
133 DdevExecCmd.Flags().BoolP("quiet", "q", false, "Suppress detailed error output")
134 DdevExecCmd.Flags().StringVarP(&serviceUser, "user", "u", "", "Defines the user to use within the container")
135 DdevExecCmd.Flags().StringP("project", "p", "", "Project to use, defaults to the one for the current directory")
136 _ = DdevExecCmd.RegisterFlagCompletionFunc("project", ddevapp.GetProjectNamesFunc("all", 0))
137 // This requires flags for exec to be specified prior to any arguments, allowing for
138 // flags to be ignored by cobra for commands that are to be executed in a container.
139 DdevExecCmd.Flags().SetInterspersed(false)
140 RootCmd.AddCommand(DdevExecCmd)
141}

Callers

nothing calls this directly

Calls 2

GetServiceNamesFuncFunction · 0.92
GetProjectNamesFuncFunction · 0.92

Tested by

no test coverage detected