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

Function newExportCommand

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

Source from the content-addressed store, hash-verified

13)
14
15func newExportCommand(dockerCLI command.Cli) *cobra.Command {
16 return &cobra.Command{
17 Use: "export [OPTIONS] CONTEXT [FILE|-]",
18 Short: "Export a context to a tar archive FILE or a tar stream on STDOUT.",
19 Args: cli.RequiresRangeArgs(1, 2),
20 RunE: func(cmd *cobra.Command, args []string) error {
21 contextName := args[0]
22 var dest string
23 if len(args) == 2 {
24 dest = args[1]
25 } else {
26 dest = contextName + ".dockercontext"
27 }
28 return runExport(dockerCLI, contextName, dest)
29 },
30 ValidArgsFunction: completeContextNames(dockerCLI, 1, true),
31 DisableFlagsInUseLine: true,
32 }
33}
34
35func writeTo(dockerCli command.Cli, reader io.Reader, dest string) error {
36 var writer io.Writer

Callers 1

newContextCommandFunction · 0.70

Calls 2

runExportFunction · 0.70
completeContextNamesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…