diff --git a/cmd/autocomplete/restart.go b/cmd/autocomplete/restart.go new file mode 100644 index 000000000..5fcf3f8e2 --- /dev/null +++ b/cmd/autocomplete/restart.go @@ -0,0 +1,26 @@ +package autocomplete + +import ( + "fmt" + + "github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli" + "github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/go-scalingo" + "github.com/Scalingo/cli/Godeps/_workspace/src/gopkg.in/errgo.v1" +) + +func RestartAutoComplete(c *cli.Context) error { + appName := CurrentAppCompletion(c) + if appName == "" { + return nil + } + + processes, err := scalingo.AppsPs(appName) + if err != nil { + return errgo.Mask(err) + } + for _, ct := range processes { + fmt.Println(ct.Name) + } + + return nil +} diff --git a/cmd/restart.go b/cmd/restart.go index 4dd7bebb5..31e2ed647 100644 --- a/cmd/restart.go +++ b/cmd/restart.go @@ -29,6 +29,7 @@ var ( }, BashComplete: func(c *cli.Context) { autocomplete.CmdFlagsAutoComplete(c, "restart") + autocomplete.RestartAutoComplete(c) }, } )