Selaa lähdekoodia

cli: move cobra customizations into cmd/dockerd

The cli package is a leftover from when the "docker" and "dockerd" cli
were both maintained in this repository; the only consumer of this is
now the dockerd CLI, so we can move this code (it should not be imported
by anyone).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 vuotta sitten
vanhempi
commit
6a90113e68
4 muutettua tiedostoa jossa 5 lisäystä ja 6 poistoa
  1. 1 1
      cmd/dockerd/cobra.go
  2. 2 3
      cmd/dockerd/docker.go
  3. 1 1
      cmd/dockerd/error.go
  4. 1 1
      cmd/dockerd/required.go

+ 1 - 1
cli/cobra.go → cmd/dockerd/cobra.go

@@ -1,4 +1,4 @@
-package cli // import "github.com/docker/docker/cli"
+package main
 
 
 import (
 import (
 	"fmt"
 	"fmt"

+ 2 - 3
cmd/dockerd/docker.go

@@ -4,7 +4,6 @@ import (
 	"fmt"
 	"fmt"
 	"os"
 	"os"
 
 
-	"github.com/docker/docker/cli"
 	"github.com/docker/docker/daemon/config"
 	"github.com/docker/docker/daemon/config"
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/pkg/jsonmessage"
 	"github.com/docker/docker/pkg/jsonmessage"
@@ -32,7 +31,7 @@ func newDaemonCommand() (*cobra.Command, error) {
 		Short:         "A self-sufficient runtime for containers.",
 		Short:         "A self-sufficient runtime for containers.",
 		SilenceUsage:  true,
 		SilenceUsage:  true,
 		SilenceErrors: true,
 		SilenceErrors: true,
-		Args:          cli.NoArgs,
+		Args:          NoArgs,
 		RunE: func(cmd *cobra.Command, args []string) error {
 		RunE: func(cmd *cobra.Command, args []string) error {
 			opts.flags = cmd.Flags()
 			opts.flags = cmd.Flags()
 			return runDaemon(opts)
 			return runDaemon(opts)
@@ -40,7 +39,7 @@ func newDaemonCommand() (*cobra.Command, error) {
 		DisableFlagsInUseLine: true,
 		DisableFlagsInUseLine: true,
 		Version:               fmt.Sprintf("%s, build %s", dockerversion.Version, dockerversion.GitCommit),
 		Version:               fmt.Sprintf("%s, build %s", dockerversion.Version, dockerversion.GitCommit),
 	}
 	}
-	cli.SetupRootCommand(cmd)
+	SetupRootCommand(cmd)
 
 
 	flags := cmd.Flags()
 	flags := cmd.Flags()
 	flags.BoolP("version", "v", false, "Print version information and quit")
 	flags.BoolP("version", "v", false, "Print version information and quit")

+ 1 - 1
cli/error.go → cmd/dockerd/error.go

@@ -1,4 +1,4 @@
-package cli // import "github.com/docker/docker/cli"
+package main
 
 
 import (
 import (
 	"fmt"
 	"fmt"

+ 1 - 1
cli/required.go → cmd/dockerd/required.go

@@ -1,4 +1,4 @@
-package cli // import "github.com/docker/docker/cli"
+package main
 
 
 import (
 import (
 	"strings"
 	"strings"