MCPcopy Index your code
hub / github.com/docker/cli / newImportCommand

Function newImportCommand

cli/command/context/import.go:15–28  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

13)
14
15func 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.
31func runImport(dockerCLI command.Cli, name string, source string) error {

Callers 1

newContextCommandFunction · 0.70

Calls 1

runImportFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…