Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C8E6D200C8F for ; Thu, 25 May 2017 12:26:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C77BF160BC7; Thu, 25 May 2017 10:26:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 48FB0160BCA for ; Thu, 25 May 2017 12:26:28 +0200 (CEST) Received: (qmail 87908 invoked by uid 500); 25 May 2017 10:26:27 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 87851 invoked by uid 99); 25 May 2017 10:26:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 May 2017 10:26:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1267FE029E; Thu, 25 May 2017 10:26:27 +0000 (UTC) From: Graeme-Miller To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-client pull request #42: Improve login handling. Content-Type: text/plain Message-Id: <20170525102627.1267FE029E@git1-us-west.apache.org> Date: Thu, 25 May 2017 10:26:26 +0000 (UTC) archived-at: Thu, 25 May 2017 10:26:28 -0000 Github user Graeme-Miller commented on a diff in the pull request: https://github.com/apache/brooklyn-client/pull/42#discussion_r118455814 --- Diff: cli/commands/login.go --- @@ -53,6 +58,30 @@ func (cmd *Login) Metadata() command_metadata.CommandMetadata { } } + +func (cmd *Login) promptAndReadUsername() (username string) { + for username == "" { + reader := bufio.NewReader(os.Stdin) + fmt.Print("Enter Username: ") + user, err := reader.ReadString('\n') + if err != nil { + error_handler.ErrorExit(err) + } + username = strings.TrimSpace(user) + } + return username +} + +func (cmd *Login) promptAndReadPassword() (password string) { + fmt.Print("Enter Password: ") --- End diff -- why no loop like in promptAndReadUsername? --- 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. ---