(dockerCLI command.Cli)
| 13 | ) |
| 14 | |
| 15 | func newImportCommand(dockerCLI command.Cli) *cobra.Command { |
| 16 | cmd := &cobra.Command{ |
| 17 | Use: "import CONTEXT FILE|-", |
| 18 | Short: "Import a context from a tar or zip file", |
| 19 | Args: cli.ExactArgs(2), |
| 20 | RunE: func(cmd *cobra.Command, args []string) error { |
| 21 | return runImport(dockerCLI, args[0], args[1]) |
| 22 | }, |
| 23 | // TODO(thaJeztah): this should also include "-" |
| 24 | ValidArgsFunction: completion.FileNames(), |
| 25 | DisableFlagsInUseLine: true, |
| 26 | } |
| 27 | return cmd |
| 28 | } |
| 29 | |
| 30 | // runImport imports a Docker context. |
| 31 | func runImport(dockerCLI command.Cli, name string, source string) error { |
no test coverage detected
searching dependent graphs…