forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login_command.go
27 lines (23 loc) · 1.85 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
package v2
import (
"code.cloudfoundry.org/cli/command"
"code.cloudfoundry.org/cli/command/translatableerror"
)
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:"Prompt for a one-time passcode to login"`
SSOPasscode string `long:"sso-passcode" description:"One-time passcode"`
Username string `short:"u" description:"Username"`
usage interface{} `usage:"CF_NAME login [-a API_URL] [-u USERNAME] [-p PASSWORD] [-o ORG] [-s SPACE] [--sso | --sso-passcode PASSCODE]\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 passcode 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 {
return translatableerror.UnrefactoredCommandError{}
}