()
| 126 | } |
| 127 | |
| 128 | func 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 | } |
nothing calls this directly
no test coverage detected