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

@ -3,9 +3,14 @@ package plugin
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(newPluginCommand)
}
// NewPluginCommand returns a cobra command for `plugin` subcommands
//
// Deprecated: Do not import commands directly. They will be removed in a future release.