forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logout.go
40 lines (34 loc) · 992 Bytes
/
logout.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package commands
import (
"github.com/cloudfoundry/cli/cf/command_metadata"
"github.com/cloudfoundry/cli/cf/configuration/core_config"
. "github.com/cloudfoundry/cli/cf/i18n"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/cloudfoundry/cli/cf/terminal"
"github.com/codegangsta/cli"
)
type Logout struct {
ui terminal.UI
config core_config.ReadWriter
}
func NewLogout(ui terminal.UI, config core_config.ReadWriter) (cmd Logout) {
cmd.ui = ui
cmd.config = config
return
}
func (cmd Logout) Metadata() command_metadata.CommandMetadata {
return command_metadata.CommandMetadata{
Name: "logout",
ShortName: "lo",
Description: T("Log user out"),
Usage: T("CF_NAME logout"),
}
}
func (cmd Logout) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
return
}
func (cmd Logout) Run(c *cli.Context) {
cmd.ui.Say(T("Logging out..."))
cmd.config.ClearSession()
cmd.ui.Ok()
}