(cmd *cobra.Command, args []string)
| 123 | } |
| 124 | |
| 125 | func execAction(cmd *cobra.Command, args []string) error { |
| 126 | options, err := execOptions(cmd) |
| 127 | if err != nil { |
| 128 | return err |
| 129 | } |
| 130 | // simulate the behavior of double dash |
| 131 | newArg := []string{} |
| 132 | if len(args) >= 2 && args[1] == "--" { |
| 133 | newArg = append(newArg, args[:1]...) |
| 134 | newArg = append(newArg, args[2:]...) |
| 135 | args = newArg |
| 136 | } |
| 137 | |
| 138 | client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address) |
| 139 | if err != nil { |
| 140 | return err |
| 141 | } |
| 142 | defer cancel() |
| 143 | |
| 144 | return container.Exec(ctx, client, args, options) |
| 145 | } |
| 146 | |
| 147 | func execShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 148 | if len(args) == 0 { |
nothing calls this directly
no test coverage detected
searching dependent graphs…