From a4e762f30b0d27eb0fc7c2d33c354834b1fb1fd6 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 6 Sep 2017 17:19:07 -0700 Subject: [PATCH] Vendor cli to get exit code 127 on unknown command --- vendor/github.com/mitchellh/cli/cli.go | 4 ++-- vendor/vendor.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vendor/github.com/mitchellh/cli/cli.go b/vendor/github.com/mitchellh/cli/cli.go index 273fbc3dc..6d0c75add 100644 --- a/vendor/github.com/mitchellh/cli/cli.go +++ b/vendor/github.com/mitchellh/cli/cli.go @@ -173,7 +173,7 @@ func (c *CLI) Run() (int, error) { // Just print the help when only '-h' or '--help' is passed. if c.IsHelp() && c.Subcommand() == "" { - c.HelpWriter.Write([]byte(c.HelpFunc(c.Commands) + "\n")) + c.HelpWriter.Write([]byte(c.HelpFunc(c.helpCommands(c.Subcommand())) + "\n")) return 0, nil } @@ -216,7 +216,7 @@ func (c *CLI) Run() (int, error) { raw, ok := c.commandTree.Get(c.Subcommand()) if !ok { c.HelpWriter.Write([]byte(c.HelpFunc(c.helpCommands(c.subcommandParent())) + "\n")) - return 1, nil + return 127, nil } command, err := raw.(CommandFactory)() diff --git a/vendor/vendor.json b/vendor/vendor.json index ad13fe16c..142fec0a0 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1033,10 +1033,10 @@ "revision": "7e024ce8ce18b21b475ac6baf8fa3c42536bf2fa" }, { - "checksumSHA1": "gPuHq0UytpuYPb2YWmFVb22Twcc=", + "checksumSHA1": "mjxSVrqngLZSyaQoEW2OLUb3oDs=", "path": "github.com/mitchellh/cli", - "revision": "0ce7cd515f64496ee660ab19f6bbf373945d3af0", - "revisionTime": "2017-08-24T19:02:09Z" + "revision": "7a1a617034de956eee640dfa5a7407ccc8c8d7e6", + "revisionTime": "2017-09-06T23:20:06Z" }, { "checksumSHA1": "ttEN1Aupb7xpPMkQLqb3tzLFdXs=",