Catch up with codegangsta/cli API deprecations
This also reconciles glide.yaml and glide.lock, which were out of sync
after the merge.
diff --git a/glide.go b/glide.go
index 899ab1c..ba23151 100644
--- a/glide.go
+++ b/glide.go
@@ -155,8 +155,9 @@
Usage: "Disable interactive prompts.",
},
},
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
action.Create(".", c.Bool("skip-import"), c.Bool("non-interactive"))
+ return nil
},
},
{
@@ -166,8 +167,9 @@
Description: `Glide will analyze a projects glide.yaml file and the imported
projects to find ways the glide.yaml file can potentially be improved. It
will then interactively make suggestions that you can skip or accept.`,
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
action.ConfigWizard(".")
+ return nil
},
},
{
@@ -223,7 +225,7 @@
Usage: "Disable interactive prompts.",
},
},
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
if len(c.Args()) < 1 {
fmt.Println("Oops! Package name is required.")
os.Exit(1)
@@ -241,6 +243,7 @@
packages := []string(c.Args())
//insecure := c.Bool("insecure")
action.Get(packages, inst, c.Bool("strip-vendor"), c.Bool("non-interactive"))
+ return nil
},
},
{
@@ -471,7 +474,7 @@
Usage: "Resolve dependencies in test files.",
},
},
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
if c.Bool("resolve-current") {
util.ResolveCurrent = true
msg.Warn("Only resolving dependencies for the current OS/Arch")
@@ -483,6 +486,7 @@
installer.Home = gpath.Home()
action.Update(installer, c.Bool("strip-vendor"), []string(c.Args()))
+ return nil
},
},
{
@@ -494,8 +498,9 @@
It ignores testdata/ and directories that begin with . or _. Packages in
vendor/ are only included if they are referenced by the main project or
one of its dependencies.`,
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
action.Tree(".", false)
+ return nil
},
},
{
@@ -508,8 +513,9 @@
Directories that begin with . or _ are ignored, as are testdata directories. Packages in
vendor are only included if they are used by the project.`,
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
action.List(".", true, c.String("output"))
+ return nil
},
Flags: []cli.Flag{
cli.StringFlag{
@@ -553,27 +559,30 @@
glide info -f "%n - %d - %h - %l"
prints 'foo - Some example description - https://example.com - MIT'`,
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
if c.IsSet("format") {
action.Info(c.String("format"))
} else {
cli.ShowCommandHelp(c, c.Command.Name)
}
+ return nil
},
},
{
Name: "cache-clear",
ShortName: "cc",
Usage: "Clears the Glide cache.",
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
action.CacheClear()
+ return nil
},
},
{
Name: "about",
Usage: "Learn about Glide",
- Action: func(c *cli.Context) {
+ Action: func(c *cli.Context) error {
action.About()
+ return nil
},
},
}
diff --git a/glide.lock b/glide.lock
index fff4efe..7979eed 100644
--- a/glide.lock
+++ b/glide.lock
@@ -1,12 +1,12 @@
-hash: e12d18f87508f2f53e2981b52a02ed23d135f59ab90f3afca813727c0685eec0
-updated: 2016-09-27T23:50:39.744887915-04:00
+hash: eff229a4411103cdd466f1af8e2540a13197c537afe1ebc4fff4493eafb6e5ea
+updated: 2016-10-02T02:12:53.210831187-04:00
imports:
- name: github.com/armon/go-radix
branch: master
revision: 4239b77079c7b5d1243b7b4736304ce8ddb6f0f2
- name: github.com/codegangsta/cli
- version: v1.14.0
- revision: 71f57d300dd6a780ac1856c005c4b518cfd498ec
+ version: v1.18.1
+ revision: a14d7d367bc02b1f57d88de97926727f2d936387
- name: github.com/Masterminds/semver
branch: 2.x
revision: b3ef6b1808e9889dfb8767ce7068db923a3d07de
diff --git a/vendor/github.com/codegangsta/cli/CHANGELOG.md b/vendor/github.com/codegangsta/cli/CHANGELOG.md
index d1904fe..be5b389 100644
--- a/vendor/github.com/codegangsta/cli/CHANGELOG.md
+++ b/vendor/github.com/codegangsta/cli/CHANGELOG.md
@@ -4,6 +4,10 @@
## [Unreleased]
+## [1.18.1] - 2016-08-28
+### Fixed
+- Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported)
+
## [1.18.0] - 2016-06-27
### Added
- `./runtests` test runner with coverage tracking by default
@@ -22,6 +26,10 @@
- No longer swallows `panic`s that occur within the `Action`s themselves when
detecting the signature of the `Action` field
+## [1.17.1] - 2016-08-28
+### Fixed
+- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
+
## [1.17.0] - 2016-05-09
### Added
- Pluggable flag-level help text rendering via `cli.DefaultFlagStringFunc`
@@ -43,6 +51,10 @@
- cleanups based on [Go Report Card
feedback](https://goreportcard.com/report/github.com/urfave/cli)
+## [1.16.1] - 2016-08-28
+### Fixed
+- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
+
## [1.16.0] - 2016-05-02
### Added
- `Hidden` field on all flag struct types to omit from generated help text
diff --git a/vendor/github.com/codegangsta/cli/app.go b/vendor/github.com/codegangsta/cli/app.go
index a046c01..2a51952 100644
--- a/vendor/github.com/codegangsta/cli/app.go
+++ b/vendor/github.com/codegangsta/cli/app.go
@@ -63,9 +63,9 @@
// It is run even if Action() panics
After AfterFunc
// The action to execute when no subcommands are specified
+ // Expects a `cli.ActionFunc` but will accept the *deprecated* signature of `func(*cli.Context) {}`
+ // *Note*: support for the deprecated `Action` signature will be removed in a future version
Action interface{}
- // TODO: replace `Action: interface{}` with `Action: ActionFunc` once some kind
- // of deprecation period has passed, maybe?
// Execute this function if the proper command cannot be found
CommandNotFound CommandNotFoundFunc
@@ -243,11 +243,12 @@
return err
}
-// DEPRECATED: Another entry point to the cli app, takes care of passing arguments and error handling
+// RunAndExitOnError calls .Run() and exits non-zero if an error was returned
+//
+// Deprecated: instead you should return an error that fulfills cli.ExitCoder
+// to cli.App.Run. This will cause the application to exit with the given eror
+// code in the cli.ExitCoder
func (a *App) RunAndExitOnError() {
- fmt.Fprintf(a.errWriter(),
- "DEPRECATED cli.App.RunAndExitOnError. %s See %s\n",
- contactSysadmin, runAndExitOnErrorDeprecationURL)
if err := a.Run(os.Args); err != nil {
fmt.Fprintln(a.errWriter(), err)
OsExiter(1)
@@ -481,9 +482,6 @@
vals := reflect.ValueOf(action).Call([]reflect.Value{reflect.ValueOf(context)})
if len(vals) == 0 {
- fmt.Fprintf(ErrWriter,
- "DEPRECATED Action signature. Must be `cli.ActionFunc`. %s See %s\n",
- contactSysadmin, appActionDeprecationURL)
return nil
}