From f9777d2517c257c6dd5cb05eb3d7271137b67e8c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 18 Aug 2025 21:35:05 +0200 Subject: [PATCH] cli: remove deprecated VisitAll, DisableFlagsInUseLine utilities These were deprecated in 6bd8a4b2b5d8854bf68256ee80964a9031ae931b, and are no longer used. Signed-off-by: Sebastiaan van Stijn --- cli/cobra.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/cli/cobra.go b/cli/cobra.go index 983e6caee30d..a38bbc02956f 100644 --- a/cli/cobra.go +++ b/cli/cobra.go @@ -166,31 +166,6 @@ func (tcmd *TopLevelCommand) Initialize(ops ...command.CLIOption) error { return tcmd.dockerCli.Initialize(tcmd.opts, ops...) } -// VisitAll will traverse all commands from the root. -// -// Deprecated: this utility was only used internally and will be removed in the next release. -func VisitAll(root *cobra.Command, fn func(*cobra.Command)) { - visitAll(root, fn) -} - -func visitAll(root *cobra.Command, fn func(*cobra.Command)) { - for _, cmd := range root.Commands() { - visitAll(cmd, fn) - } - fn(root) -} - -// DisableFlagsInUseLine sets the DisableFlagsInUseLine flag on all -// commands within the tree rooted at cmd. -// -// Deprecated: this utility was only used internally and will be removed in the next release. -func DisableFlagsInUseLine(cmd *cobra.Command) { - visitAll(cmd, func(ccmd *cobra.Command) { - // do not add a `[flags]` to the end of the usage line. - ccmd.DisableFlagsInUseLine = true - }) -} - var helpCommand = &cobra.Command{ Use: "help [command]", Short: "Help about the command",