From e56d2c12d2ccc342e11c1d5acdb9da4660d519d4 Mon Sep 17 00:00:00 2001 From: "Joel D. Elkins" Date: Sun, 31 Jul 2022 00:57:18 -0500 Subject: [PATCH] Rename getAndExecute -> execForEach --- cmd/create.go | 2 +- cmd/execute.go | 2 +- cmd/pull.go | 2 +- cmd/recreate.go | 2 +- cmd/restart.go | 2 +- cmd/rm.go | 2 +- cmd/start.go | 2 +- cmd/stop.go | 2 +- cmd/update.go | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/create.go b/cmd/create.go index 3236be7..f58b690 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -38,7 +38,7 @@ var createCmd = &cobra.Command{ names or categories. Multiple arguments are supported.`, Run: func(_ *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.CreateCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.CreateCommands() }) }, } diff --git a/cmd/execute.go b/cmd/execute.go index 6795408..3ac1f37 100644 --- a/cmd/execute.go +++ b/cmd/execute.go @@ -29,7 +29,7 @@ import ( "github.com/sirupsen/logrus" ) -func getAndExecute(tgts []container.Container, getSet func(*container.Container) command.CommandSet) { +func execForEach(tgts []container.Container, getSet func(*container.Container) command.CommandSet) { var wg sync.WaitGroup for i := range tgts { wg.Add(1) diff --git a/cmd/pull.go b/cmd/pull.go index 341e10d..0e78005 100644 --- a/cmd/pull.go +++ b/cmd/pull.go @@ -39,7 +39,7 @@ affected: the old image will still remain, though untagged, and any defined cont will still use it.`, Run: func(cmd *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.PullCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.PullCommands() }) }, } diff --git a/cmd/recreate.go b/cmd/recreate.go index 112bd1a..d7bad37 100644 --- a/cmd/recreate.go +++ b/cmd/recreate.go @@ -38,7 +38,7 @@ var recreateCmd = &cobra.Command{ one or more container names or categories. If empty, "all" is assumed.`, Run: func(_ *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.RecreateCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.RecreateCommands() }) }, } diff --git a/cmd/restart.go b/cmd/restart.go index 7360bdc..9a08e68 100644 --- a/cmd/restart.go +++ b/cmd/restart.go @@ -38,7 +38,7 @@ var restartCmd = &cobra.Command{ one or more container names or categories. If empty, "all" is assumed.`, Run: func(_ *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.RestartCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.RestartCommands() }) }, } diff --git a/cmd/rm.go b/cmd/rm.go index ac883bc..1194bcb 100644 --- a/cmd/rm.go +++ b/cmd/rm.go @@ -39,7 +39,7 @@ var rmCmd = &cobra.Command{ If running, they will first be stopped.`, Run: func(cmd *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.RemoveCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.RemoveCommands() }) }, } diff --git a/cmd/start.go b/cmd/start.go index 8dd7f3e..cba47bb 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -38,7 +38,7 @@ var startCmd = &cobra.Command{ one or more container names or categories. If empty, "all" is assumed.`, Run: func(_ *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.StartCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.StartCommands() }) }, } diff --git a/cmd/stop.go b/cmd/stop.go index 5529904..5794eaa 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -38,7 +38,7 @@ var stopCmd = &cobra.Command{ one or more container names or categories. If empty, "all" is assumed.`, Run: func(_ *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.StopCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.StopCommands() }) }, } diff --git a/cmd/update.go b/cmd/update.go index fdd047e..53af98e 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -38,7 +38,7 @@ var updateCmd = &cobra.Command{ one or more container names or categories. If empty, "all" is assumed.`, Run: func(_ *cobra.Command, args []string) { conts := config.Union(args, contMask) - getAndExecute(conts, func(c *container.Container) command.CommandSet { return c.UpdateCommands() }) + execForEach(conts, func(c *container.Container) command.CommandSet { return c.UpdateCommands() }) }, }