Merge pull request #3169 from hashicorp/v-cli

Vendor cli to get exit code 127 on unknown command
This commit is contained in:
Alex Dadgar
2017-09-07 12:35:43 -07:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -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)()

6
vendor/vendor.json vendored
View File

@@ -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=",