mirror of https://github.com/docker/cli.git
Merge pull request #1362 from vdemeester/engine-only-linux
Add `docker engine` commands only on Linux…
This commit is contained in:
commit
82dff32bb4
|
@ -2,6 +2,7 @@ package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
"github.com/docker/cli/cli/command/builder"
|
"github.com/docker/cli/cli/command/builder"
|
||||||
|
@ -85,9 +86,6 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
|
||||||
// volume
|
// volume
|
||||||
volume.NewVolumeCommand(dockerCli),
|
volume.NewVolumeCommand(dockerCli),
|
||||||
|
|
||||||
// engine
|
|
||||||
engine.NewEngineCommand(dockerCli),
|
|
||||||
|
|
||||||
// legacy commands may be hidden
|
// legacy commands may be hidden
|
||||||
hide(system.NewEventsCommand(dockerCli)),
|
hide(system.NewEventsCommand(dockerCli)),
|
||||||
hide(system.NewInfoCommand(dockerCli)),
|
hide(system.NewInfoCommand(dockerCli)),
|
||||||
|
@ -124,7 +122,10 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
|
||||||
hide(image.NewSaveCommand(dockerCli)),
|
hide(image.NewSaveCommand(dockerCli)),
|
||||||
hide(image.NewTagCommand(dockerCli)),
|
hide(image.NewTagCommand(dockerCli)),
|
||||||
)
|
)
|
||||||
|
if runtime.GOOS == "linux" {
|
||||||
|
// engine
|
||||||
|
cmd.AddCommand(engine.NewEngineCommand(dockerCli))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func hide(cmd *cobra.Command) *cobra.Command {
|
func hide(cmd *cobra.Command) *cobra.Command {
|
||||||
|
|
Loading…
Reference in New Issue