From 272983b2d6e97a50cd69a93e2f192bcacb44d7ee Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Tue, 16 May 2017 21:41:08 +0800 Subject: [PATCH] Replace github.com/codegangsta/cli with github.com/urfave/cli close #284 Signed-off-by: Lai Jiangshan --- Godeps/Godeps.json | 8 ++++---- containerd/containerd.go | 2 +- create.go | 2 +- exec.go | 2 +- kill.go | 2 +- list.go | 2 +- main.go | 2 +- manage.go | 2 +- run.go | 2 +- shim.go | 2 +- spec.go | 2 +- start.go | 2 +- state.go | 2 +- .../{codegangsta => urfave}/cli/.flake8 | 0 .../{codegangsta => urfave}/cli/.gitignore | 0 .../{codegangsta => urfave}/cli/.travis.yml | 9 ++++----- .../{codegangsta => urfave}/cli/CHANGELOG.md | 0 .../{codegangsta => urfave}/cli/LICENSE | 0 .../{codegangsta => urfave}/cli/README.md | 0 .../{codegangsta => urfave}/cli/app.go | 0 .../{codegangsta => urfave}/cli/appveyor.yml | 0 .../{codegangsta => urfave}/cli/category.go | 0 .../{codegangsta => urfave}/cli/cli.go | 0 .../{codegangsta => urfave}/cli/command.go | 16 ++++++++-------- .../{codegangsta => urfave}/cli/context.go | 0 .../{codegangsta => urfave}/cli/errors.go | 0 .../{codegangsta => urfave}/cli/flag-types.json | 0 .../{codegangsta => urfave}/cli/flag.go | 0 .../cli/flag_generated.go | 0 .../{codegangsta => urfave}/cli/funcs.go | 0 .../cli/generate-flag-types | 0 .../{codegangsta => urfave}/cli/help.go | 0 .../{codegangsta => urfave}/cli/runtests | 0 33 files changed, 28 insertions(+), 29 deletions(-) rename vendor/github.com/{codegangsta => urfave}/cli/.flake8 (100%) rename vendor/github.com/{codegangsta => urfave}/cli/.gitignore (100%) rename vendor/github.com/{codegangsta => urfave}/cli/.travis.yml (85%) rename vendor/github.com/{codegangsta => urfave}/cli/CHANGELOG.md (100%) rename vendor/github.com/{codegangsta => urfave}/cli/LICENSE (100%) rename vendor/github.com/{codegangsta => urfave}/cli/README.md (100%) rename vendor/github.com/{codegangsta => urfave}/cli/app.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/appveyor.yml (100%) rename vendor/github.com/{codegangsta => urfave}/cli/category.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/cli.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/command.go (95%) rename vendor/github.com/{codegangsta => urfave}/cli/context.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/errors.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/flag-types.json (100%) rename vendor/github.com/{codegangsta => urfave}/cli/flag.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/flag_generated.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/funcs.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/generate-flag-types (100%) rename vendor/github.com/{codegangsta => urfave}/cli/help.go (100%) rename vendor/github.com/{codegangsta => urfave}/cli/runtests (100%) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 9e5e9707..86fb4e12 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,7 +1,7 @@ { "ImportPath": "github.com/hyperhq/runv", "GoVersion": "go1.7", - "GodepVersion": "v79", + "GodepVersion": "v75", "Packages": [ "./..." ], @@ -27,9 +27,9 @@ "Rev": "dfaa4d491586af21e1ce06028df3926389a99654" }, { - "ImportPath": "github.com/codegangsta/cli", - "Comment": "v1.19.1-24-g9e5b048", - "Rev": "9e5b04886c4bfee2ceba1465b8121057355c4e53" + "ImportPath": "github.com/urfave/cli", + "Comment": "v1.19.1-36-gd70f47e", + "Rev": "d70f47eeca3afd795160003bc6e28b001d60c67c" }, { "ImportPath": "github.com/docker/docker/integration-cli/checker", diff --git a/containerd/containerd.go b/containerd/containerd.go index 42f51245..dd351270 100644 --- a/containerd/containerd.go +++ b/containerd/containerd.go @@ -11,7 +11,6 @@ import ( "syscall" "time" - "github.com/codegangsta/cli" "github.com/golang/glog" "github.com/hyperhq/runv/containerd/api/grpc/server" "github.com/hyperhq/runv/containerd/api/grpc/types" @@ -22,6 +21,7 @@ import ( "github.com/hyperhq/runv/hypervisor" "github.com/hyperhq/runv/supervisor" templatecore "github.com/hyperhq/runv/template" + "github.com/urfave/cli" "google.golang.org/grpc" "google.golang.org/grpc/health" "google.golang.org/grpc/health/grpc_health_v1" diff --git a/create.go b/create.go index 5161ab39..9c52f685 100644 --- a/create.go +++ b/create.go @@ -10,11 +10,11 @@ import ( "syscall" "time" - "github.com/codegangsta/cli" "github.com/hyperhq/runv/containerd/api/grpc/types" "github.com/kardianos/osext" "github.com/kr/pty" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/urfave/cli" netcontext "golang.org/x/net/context" ) diff --git a/exec.go b/exec.go index 8e431291..826068c9 100644 --- a/exec.go +++ b/exec.go @@ -8,10 +8,10 @@ import ( "strconv" "strings" - "github.com/codegangsta/cli" "github.com/hyperhq/runv/containerd/api/grpc/types" "github.com/hyperhq/runv/lib/term" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/urfave/cli" netcontext "golang.org/x/net/context" ) diff --git a/kill.go b/kill.go index d4d16615..6d927167 100644 --- a/kill.go +++ b/kill.go @@ -8,9 +8,9 @@ import ( "strings" "syscall" - "github.com/codegangsta/cli" "github.com/hyperhq/runv/containerd/api/grpc/types" "github.com/hyperhq/runv/lib/linuxsignal" + "github.com/urfave/cli" netcontext "golang.org/x/net/context" ) diff --git a/list.go b/list.go index 8d7a6c1e..5aabc4a4 100644 --- a/list.go +++ b/list.go @@ -9,8 +9,8 @@ import ( "text/tabwriter" "time" - "github.com/codegangsta/cli" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/urfave/cli" ) const formatOptions = `table or json` diff --git a/main.go b/main.go index 3cac52a5..c9989456 100644 --- a/main.go +++ b/main.go @@ -9,12 +9,12 @@ import ( "os" "time" - "github.com/codegangsta/cli" "github.com/docker/docker/pkg/reexec" "github.com/golang/protobuf/ptypes" "github.com/hyperhq/runv/containerd" "github.com/hyperhq/runv/containerd/api/grpc/types" _ "github.com/hyperhq/runv/supervisor/proxy" // for proxy.init() + "github.com/urfave/cli" netcontext "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/grpclog" diff --git a/manage.go b/manage.go index 87bec72e..a89c31a6 100644 --- a/manage.go +++ b/manage.go @@ -7,11 +7,11 @@ import ( "path/filepath" "syscall" - "github.com/codegangsta/cli" "github.com/golang/glog" "github.com/hyperhq/runv/driverloader" "github.com/hyperhq/runv/hypervisor" templatecore "github.com/hyperhq/runv/template" + "github.com/urfave/cli" ) var manageSubCmds = []cli.Command{ diff --git a/run.go b/run.go index ae98c651..ddd1b33f 100644 --- a/run.go +++ b/run.go @@ -1,7 +1,7 @@ package main import ( - "github.com/codegangsta/cli" + "github.com/urfave/cli" ) var runCommand = cli.Command{ diff --git a/shim.go b/shim.go index b4746613..874a39f0 100644 --- a/shim.go +++ b/shim.go @@ -7,10 +7,10 @@ import ( "path/filepath" "syscall" - "github.com/codegangsta/cli" "github.com/golang/glog" "github.com/hyperhq/runv/containerd/api/grpc/types" "github.com/hyperhq/runv/lib/term" + "github.com/urfave/cli" "golang.org/x/net/context" ) diff --git a/spec.go b/spec.go index 26975a2f..c6713ce3 100644 --- a/spec.go +++ b/spec.go @@ -7,8 +7,8 @@ import ( "os" "runtime" - "github.com/codegangsta/cli" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/urfave/cli" ) var specCommand = cli.Command{ diff --git a/start.go b/start.go index 744b7f88..4b30f1a4 100644 --- a/start.go +++ b/start.go @@ -6,10 +6,10 @@ import ( "os" "path/filepath" - "github.com/codegangsta/cli" "github.com/hyperhq/runv/containerd/api/grpc/types" "github.com/hyperhq/runv/lib/term" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/urfave/cli" netcontext "golang.org/x/net/context" ) diff --git a/state.go b/state.go index 0a3cd2b3..a3a7bfb4 100644 --- a/state.go +++ b/state.go @@ -9,7 +9,7 @@ import ( "path/filepath" "time" - "github.com/codegangsta/cli" + "github.com/urfave/cli" ) // cState represents the platform agnostic pieces relating to a running diff --git a/vendor/github.com/codegangsta/cli/.flake8 b/vendor/github.com/urfave/cli/.flake8 similarity index 100% rename from vendor/github.com/codegangsta/cli/.flake8 rename to vendor/github.com/urfave/cli/.flake8 diff --git a/vendor/github.com/codegangsta/cli/.gitignore b/vendor/github.com/urfave/cli/.gitignore similarity index 100% rename from vendor/github.com/codegangsta/cli/.gitignore rename to vendor/github.com/urfave/cli/.gitignore diff --git a/vendor/github.com/codegangsta/cli/.travis.yml b/vendor/github.com/urfave/cli/.travis.yml similarity index 85% rename from vendor/github.com/codegangsta/cli/.travis.yml rename to vendor/github.com/urfave/cli/.travis.yml index 94836d75..890e1859 100644 --- a/vendor/github.com/codegangsta/cli/.travis.yml +++ b/vendor/github.com/urfave/cli/.travis.yml @@ -7,12 +7,9 @@ cache: - node_modules go: -- 1.2.x -- 1.3.x -- 1.4.2 -- 1.5.x - 1.6.x - 1.7.x +- 1.8.x - master matrix: @@ -23,10 +20,12 @@ matrix: os: osx - go: 1.7.x os: osx + - go: 1.8.x + os: osx before_script: - go get github.com/urfave/gfmrun/... || true -- go get golang.org/x/tools/... || true +- go get golang.org/x/tools/cmd/goimports - if [ ! -f node_modules/.bin/markdown-toc ] ; then npm install markdown-toc ; fi diff --git a/vendor/github.com/codegangsta/cli/CHANGELOG.md b/vendor/github.com/urfave/cli/CHANGELOG.md similarity index 100% rename from vendor/github.com/codegangsta/cli/CHANGELOG.md rename to vendor/github.com/urfave/cli/CHANGELOG.md diff --git a/vendor/github.com/codegangsta/cli/LICENSE b/vendor/github.com/urfave/cli/LICENSE similarity index 100% rename from vendor/github.com/codegangsta/cli/LICENSE rename to vendor/github.com/urfave/cli/LICENSE diff --git a/vendor/github.com/codegangsta/cli/README.md b/vendor/github.com/urfave/cli/README.md similarity index 100% rename from vendor/github.com/codegangsta/cli/README.md rename to vendor/github.com/urfave/cli/README.md diff --git a/vendor/github.com/codegangsta/cli/app.go b/vendor/github.com/urfave/cli/app.go similarity index 100% rename from vendor/github.com/codegangsta/cli/app.go rename to vendor/github.com/urfave/cli/app.go diff --git a/vendor/github.com/codegangsta/cli/appveyor.yml b/vendor/github.com/urfave/cli/appveyor.yml similarity index 100% rename from vendor/github.com/codegangsta/cli/appveyor.yml rename to vendor/github.com/urfave/cli/appveyor.yml diff --git a/vendor/github.com/codegangsta/cli/category.go b/vendor/github.com/urfave/cli/category.go similarity index 100% rename from vendor/github.com/codegangsta/cli/category.go rename to vendor/github.com/urfave/cli/category.go diff --git a/vendor/github.com/codegangsta/cli/cli.go b/vendor/github.com/urfave/cli/cli.go similarity index 100% rename from vendor/github.com/codegangsta/cli/cli.go rename to vendor/github.com/urfave/cli/cli.go diff --git a/vendor/github.com/codegangsta/cli/command.go b/vendor/github.com/urfave/cli/command.go similarity index 95% rename from vendor/github.com/codegangsta/cli/command.go rename to vendor/github.com/urfave/cli/command.go index 40ebdb64..63f183ae 100644 --- a/vendor/github.com/codegangsta/cli/command.go +++ b/vendor/github.com/urfave/cli/command.go @@ -154,19 +154,20 @@ func (c Command) Run(ctx *Context) (err error) { } context := NewContext(ctx.App, set, ctx) + context.Command = c if checkCommandCompletions(context, c.Name) { return nil } if err != nil { if c.OnUsageError != nil { - err := c.OnUsageError(ctx, err, false) + err := c.OnUsageError(context, err, false) HandleExitCoder(err) return err } - fmt.Fprintln(ctx.App.Writer, "Incorrect Usage:", err.Error()) - fmt.Fprintln(ctx.App.Writer) - ShowCommandHelp(ctx, c.Name) + fmt.Fprintln(context.App.Writer, "Incorrect Usage:", err.Error()) + fmt.Fprintln(context.App.Writer) + ShowCommandHelp(context, c.Name) return err } @@ -191,9 +192,9 @@ func (c Command) Run(ctx *Context) (err error) { if c.Before != nil { err = c.Before(context) if err != nil { - fmt.Fprintln(ctx.App.Writer, err) - fmt.Fprintln(ctx.App.Writer) - ShowCommandHelp(ctx, c.Name) + fmt.Fprintln(context.App.Writer, err) + fmt.Fprintln(context.App.Writer) + ShowCommandHelp(context, c.Name) HandleExitCoder(err) return err } @@ -203,7 +204,6 @@ func (c Command) Run(ctx *Context) (err error) { c.Action = helpSubcommand.Action } - context.Command = c err = HandleAction(c.Action, context) if err != nil { diff --git a/vendor/github.com/codegangsta/cli/context.go b/vendor/github.com/urfave/cli/context.go similarity index 100% rename from vendor/github.com/codegangsta/cli/context.go rename to vendor/github.com/urfave/cli/context.go diff --git a/vendor/github.com/codegangsta/cli/errors.go b/vendor/github.com/urfave/cli/errors.go similarity index 100% rename from vendor/github.com/codegangsta/cli/errors.go rename to vendor/github.com/urfave/cli/errors.go diff --git a/vendor/github.com/codegangsta/cli/flag-types.json b/vendor/github.com/urfave/cli/flag-types.json similarity index 100% rename from vendor/github.com/codegangsta/cli/flag-types.json rename to vendor/github.com/urfave/cli/flag-types.json diff --git a/vendor/github.com/codegangsta/cli/flag.go b/vendor/github.com/urfave/cli/flag.go similarity index 100% rename from vendor/github.com/codegangsta/cli/flag.go rename to vendor/github.com/urfave/cli/flag.go diff --git a/vendor/github.com/codegangsta/cli/flag_generated.go b/vendor/github.com/urfave/cli/flag_generated.go similarity index 100% rename from vendor/github.com/codegangsta/cli/flag_generated.go rename to vendor/github.com/urfave/cli/flag_generated.go diff --git a/vendor/github.com/codegangsta/cli/funcs.go b/vendor/github.com/urfave/cli/funcs.go similarity index 100% rename from vendor/github.com/codegangsta/cli/funcs.go rename to vendor/github.com/urfave/cli/funcs.go diff --git a/vendor/github.com/codegangsta/cli/generate-flag-types b/vendor/github.com/urfave/cli/generate-flag-types similarity index 100% rename from vendor/github.com/codegangsta/cli/generate-flag-types rename to vendor/github.com/urfave/cli/generate-flag-types diff --git a/vendor/github.com/codegangsta/cli/help.go b/vendor/github.com/urfave/cli/help.go similarity index 100% rename from vendor/github.com/codegangsta/cli/help.go rename to vendor/github.com/urfave/cli/help.go diff --git a/vendor/github.com/codegangsta/cli/runtests b/vendor/github.com/urfave/cli/runtests similarity index 100% rename from vendor/github.com/codegangsta/cli/runtests rename to vendor/github.com/urfave/cli/runtests