Skip to content

Commit

Permalink
Correctly display help whe nthe users types an unknown command
Browse files Browse the repository at this point in the history
Fixes #365
  • Loading branch information
Soulou committed Jul 4, 2018
1 parent 41809bd commit cd4ba80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog

* [logs] accepts filter for postdeploy and one-off container
* [authentication] use of the new authentication API `auth.scalingo.com`
* [help] fix missing help with unknown commsnds #365

### 1.7.0

Expand Down
5 changes: 2 additions & 3 deletions cmd/help.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cmd

import (
"github.com/urfave/cli"
"github.com/Scalingo/cli/cmd/autocomplete"
"github.com/urfave/cli"
)

var (
Expand All @@ -13,9 +13,8 @@ var (
args := c.Args()
if args.Present() {
cli.ShowCommandHelp(c, args.First())
} else {
cli.ShowAppHelp(c)
}
cli.ShowAppHelp(c)
},
BashComplete: func(c *cli.Context) {
autocomplete.CmdFlagsAutoComplete(c, "help")
Expand Down
3 changes: 2 additions & 1 deletion scalingo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ COMMANDS:{{range .VisibleCategories}}{{if .Name}}
{{end}}{{end}}{{if .VisibleFlags}}
GLOBAL OPTIONS:
{{range $index, $option := .VisibleFlags}}{{if $index}}
{{end}}{{$option}}{{end}}{{end}}{{if .Copyright}}
{{end}}{{$option}}{{end}}{{end}}
{{if .Copyright}}
COPYRIGHT:
{{.Copyright}}{{end}}
Expand Down

0 comments on commit cd4ba80

Please sign in to comment.