github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v2/login_command.go (about) 1 package v2 2 3 import ( 4 "os" 5 6 "github.com/liamawhite/cli-with-i18n/cf/cmd" 7 "github.com/liamawhite/cli-with-i18n/command" 8 ) 9 10 type LoginCommand struct { 11 APIEndpoint string `short:"a" description:"API endpoint (e.g. https://api.example.com)"` 12 Organization string `short:"o" description:"Org"` 13 Password string `short:"p" description:"Password"` 14 Space string `short:"s" description:"Space"` 15 SkipSSLValidation bool `long:"skip-ssl-validation" description:"Skip verification of the API endpoint. Not recommended!"` 16 SSO bool `long:"sso" description:"Prompt for a one-time passcode to login"` 17 SSOPasscode string `long:"sso-passcode" description:"One-time passcode"` 18 Username string `short:"u" description:"Username"` 19 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)"` 20 relatedCommands interface{} `related_commands:"api, auth, target"` 21 } 22 23 func (LoginCommand) Setup(config command.Config, ui command.UI) error { 24 return nil 25 } 26 27 func (LoginCommand) Execute(args []string) error { 28 cmd.Main(os.Getenv("CF_TRACE"), os.Args) 29 return nil 30 }