Register CLI commands implicitly

This patch removes the explicit `commands.AddCommands` function and
instead relies upon the `internal/commands` package which registers each
CLI command using `init()` instead.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
Alano Terblanche
2025-08-20 14:46:03 +02:00
parent 4d93a6486e
commit 56cab16779
21 changed files with 162 additions and 159 deletions

View File

@ -6,11 +6,16 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/internal/commands"
"github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
func init() {
commands.Register(newNodeCommand)
}
// NewNodeCommand returns a cobra command for `node` subcommands
//
// Deprecated: Do not import commands directly. They will be removed in a future release.