Improve UX when importing keys into wallet using CLI
This commit is contained in:
parent
37d5baf0b2
commit
f2c518455e
@ -1,6 +1,7 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -205,7 +206,9 @@ var walletImport = &cli.Command{
|
|||||||
|
|
||||||
var hexdata []byte
|
var hexdata []byte
|
||||||
if !cctx.Args().Present() || cctx.Args().First() == "-" {
|
if !cctx.Args().Present() || cctx.Args().First() == "-" {
|
||||||
indata, err := ioutil.ReadAll(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
fmt.Print("Enter private key: ")
|
||||||
|
indata, err := reader.ReadBytes('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user