-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathcmd.go
More file actions
36 lines (32 loc) · 817 Bytes
/
cmd.go
File metadata and controls
36 lines (32 loc) · 817 Bytes
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
package context
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(newContextCommand)
}
// newContextCommand returns the context cli subcommand
func newContextCommand(dockerCLI command.Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "context",
Short: "Manage contexts",
Args: cli.NoArgs,
RunE: command.ShowHelp(dockerCLI.Err()),
DisableFlagsInUseLine: true,
}
cmd.AddCommand(
newCreateCommand(dockerCLI),
newListCommand(dockerCLI),
newUseCommand(dockerCLI),
newExportCommand(dockerCLI),
newImportCommand(dockerCLI),
newRemoveCommand(dockerCLI),
newUpdateCommand(dockerCLI),
newInspectCommand(dockerCLI),
newShowCommand(dockerCLI),
)
return cmd
}