brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnmccabe <...@git.apache.org>
Subject [GitHub] brooklyn-client pull request #42: Improve login handling.
Date Tue, 18 Apr 2017 13:57:43 GMT
Github user johnmccabe commented on a diff in the pull request:

    https://github.com/apache/brooklyn-client/pull/42#discussion_r111959919
  
    --- Diff: cli/commands/login.go ---
    @@ -76,6 +81,17 @@ func (cmd *Login) Run(scope scope.Scope, c *cli.Context) {
     		cmd.network.BrooklynUrl = cmd.network.BrooklynUrl[0 : len(cmd.network.BrooklynUrl)-1]
     	}
     
    +	// Prompt for username if not supplied
    +	if cmd.network.BrooklynUser == "" {
    +		reader := bufio.NewReader(os.Stdin)
    +		fmt.Print("Enter Username: ")
    +		user, err := reader.ReadString('\n')
    +		if err != nil {
    +			error_handler.ErrorExit(err)
    +		}
    +		cmd.network.BrooklynUser = strings.TrimSpace(user)
    --- End diff --
    
    You can end up with an empty string for the user, should pull this out into a function
and potentially retry if no name is supplied.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message