forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login_command.go
29 lines (24 loc) · 1.72 KB
/
login_command.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
package v2
import (
"os"
"code.cloudfoundry.org/cli/cf/cmd"
"code.cloudfoundry.org/cli/command"
)
type LoginCommand struct {
APIEndpoint string `short:"a" description:"API endpoint (e.g. https://api.example.com)"`
Organization string `short:"o" description:"Org"`
Password string `short:"p" description:"Password"`
Space string `short:"s" description:"Space"`
SkipSSLValidation bool `long:"skip-ssl-validation" description:"Skip verification of the API endpoint. Not recommended!"`
SSO bool `long:"sso" description:"Use a one-time password to login"`
Username string `short:"u" description:"Username"`
usage interface{} `usage:"CF_NAME login [-a API_URL] [-u USERNAME] [-p PASSWORD] [-o ORG] [-s SPACE]\n\nWARNING:\n Providing your password as a command line option is highly discouraged\n Your password may be visible to others and may be recorded in your shell history\n\nEXAMPLES:\n CF_NAME login (omit username and password to login interactively -- CF_NAME will prompt for both)\n CF_NAME login -u name@example.com -p pa55woRD (specify username and password as arguments)\n CF_NAME login -u name@example.com -p \"my password\" (use quotes for passwords with a space)\n CF_NAME login -u name@example.com -p \"\\\"password\\\"\" (escape quotes if used in password)\n CF_NAME login --sso (CF_NAME will provide a url to obtain a one-time password to login)"`
relatedCommands interface{} `related_commands:"api, auth, target"`
}
func (_ LoginCommand) Setup(config command.Config, ui command.UI) error {
return nil
}
func (_ LoginCommand) Execute(args []string) error {
cmd.Main(os.Getenv("CF_TRACE"), os.Args)
return nil
}