Skip to content

Commit

Permalink
Merge pull request #6 from skmatz/patch-1
Browse files Browse the repository at this point in the history
Change not to display when entering password
  • Loading branch information
sachaos authored Feb 26, 2020
2 parents f3fb9b6 + fd16f35 commit 3f40938
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ package cmd

import (
"fmt"
"os"
"path"
"syscall"

"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"os"
"path"
"golang.org/x/crypto/ssh/terminal"
)

// configCmd represents the config command
Expand All @@ -18,7 +21,9 @@ var configCmd = &cobra.Command{
fmt.Printf("username: ")
fmt.Scanf("%s", &username)
fmt.Printf("password: ")
fmt.Scanf("%s", &password)
bytePassword, _ := terminal.ReadPassword(int(syscall.Stdin))
password = string(bytePassword)
fmt.Printf("\n")
fmt.Printf("language (list supported languages by `atcoder languages`): ")
fmt.Scanf("%s", &language)

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ require (
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.3.0
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20200219183655-46282727080f // indirect
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect
gopkg.in/yaml.v2 v2.2.8
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down

0 comments on commit 3f40938

Please sign in to comment.