-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathcmd.go
More file actions
49 lines (45 loc) · 1.27 KB
/
cmd.go
File metadata and controls
49 lines (45 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package image
import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/internal/commands"
"github.com/spf13/cobra"
)
func init() {
commands.Register(newBuildCommand)
commands.Register(newPullCommand)
commands.Register(newPushCommand)
commands.Register(newImagesCommand)
commands.Register(newImageCommand)
commands.RegisterLegacy(newHistoryCommand)
commands.RegisterLegacy(newImportCommand)
commands.RegisterLegacy(newLoadCommand)
commands.RegisterLegacy(newRemoveCommand)
commands.RegisterLegacy(newSaveCommand)
commands.RegisterLegacy(newTagCommand)
}
// newImageCommand returns a cobra command for `image` subcommands
func newImageCommand(dockerCli command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "image",
Short: "Manage images",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCli.Err()),
DisableFlagsInUseLine: true,
}
cmd.AddCommand(
newBuildCommand(dockerCli),
newHistoryCommand(dockerCli),
newImportCommand(dockerCli),
newLoadCommand(dockerCli),
newPullCommand(dockerCli),
newPushCommand(dockerCli),
newSaveCommand(dockerCli),
newTagCommand(dockerCli),
newListCommand(dockerCli),
newImageRemoveCommand(dockerCli),
newInspectCommand(dockerCli),
newPruneCommand(dockerCli),
)
return cmd
}