From eee9bf449fbb7987ce615145692484087e73e31e Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Mon, 4 May 2020 10:28:42 +0200 Subject: [PATCH] Move run to own package --- cli/cmd/{run_opts.go => run/opts.go} | 2 +- cli/cmd/{ => run}/run.go | 7 ++++--- cli/main.go | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) rename cli/cmd/{run_opts.go => run/opts.go} (98%) rename cli/cmd/{ => run}/run.go (97%) diff --git a/cli/cmd/run_opts.go b/cli/cmd/run/opts.go similarity index 98% rename from cli/cmd/run_opts.go rename to cli/cmd/run/opts.go index ee536ef36..f632a9ec5 100644 --- a/cli/cmd/run_opts.go +++ b/cli/cmd/run/opts.go @@ -1,4 +1,4 @@ -package cmd +package run import ( "strconv" diff --git a/cli/cmd/run.go b/cli/cmd/run/run.go similarity index 97% rename from cli/cmd/run.go rename to cli/cmd/run/run.go index 7b58c248a..8e92a6156 100644 --- a/cli/cmd/run.go +++ b/cli/cmd/run/run.go @@ -25,17 +25,18 @@ THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cmd +package run import ( "context" - "github.com/docker/api/client" "github.com/google/uuid" "github.com/spf13/cobra" + + "github.com/docker/api/client" ) -func RunCommand() *cobra.Command { +func Command() *cobra.Command { var opts runOpts cmd := &cobra.Command{ Use: "run", diff --git a/cli/main.go b/cli/main.go index 32c11debc..ef0c15bc0 100644 --- a/cli/main.go +++ b/cli/main.go @@ -44,6 +44,7 @@ import ( "github.com/spf13/cobra" "github.com/docker/api/cli/cmd" + "github.com/docker/api/cli/cmd/run" apicontext "github.com/docker/api/context" "github.com/docker/api/context/store" "github.com/docker/api/util" @@ -98,7 +99,7 @@ func main() { &cmd.PsCommand, cmd.ServeCommand(), &cmd.ExampleCommand, - cmd.RunCommand(), + run.Command(), ) helpFunc := root.HelpFunc()