From eb83cdd2cfd933933b100f734c96701f1c63db2f Mon Sep 17 00:00:00 2001 From: Kosaku Kimura Date: Mon, 10 Feb 2020 23:41:03 +0900 Subject: [PATCH] use cli v2 --- go.mod | 2 +- go.sum | 12 ++++++++++-- gongfig.go | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 5a9dd3e..3e4e148 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,6 @@ go 1.12 require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/mitchellh/mapstructure v1.1.2 - github.com/urfave/cli v1.21.0 + github.com/urfave/cli/v2 v2.1.1 gopkg.in/getlantern/deepcopy.v1 v1.0.0-20140913144530-b923171e8640 ) diff --git a/go.sum b/go.sum index 35c9674..8e63581 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,18 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/urfave/cli v1.21.0 h1:wYSSj06510qPIzGSua9ZqsncMmWE3Zr55KBERygyrxE= -github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= +github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/getlantern/deepcopy.v1 v1.0.0-20140913144530-b923171e8640 h1:fAfAHq363jp6NTMDHNe4EhfiIBPRR0JFJuBefZyVLaM= gopkg.in/getlantern/deepcopy.v1 v1.0.0-20140913144530-b923171e8640/go.mod h1:FeLAK3+BLfs7XMpGW8/75D+a2nq5bemZgvOR5BkhcYA= diff --git a/gongfig.go b/gongfig.go index d1cd647..8d942f3 100644 --- a/gongfig.go +++ b/gongfig.go @@ -1,7 +1,7 @@ package main import ( - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "os" "log" "fmt" @@ -15,19 +15,19 @@ func getApp() *cli.App { app.Version = "0.0.1" flags := []cli.Flag { - cli.StringFlag{ + &cli.StringFlag{ Name: "url", Value: actions.DefaultURL, Usage: "Kong admin api url", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "file", Value: "config.yml", Usage: "File for export/import", }, } - app.Commands = []cli.Command{ + app.Commands = []*cli.Command{ { Name: "export", Usage: "Obtain services and routes, write it to the config file",