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>
This commit is contained in:
Sebastiaan van Stijn 2022-12-14 11:37:51 +01:00
parent 3d58b43efe
commit 6a90113e68
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
4 changed files with 5 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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