Skip to content

Commit

Permalink
Just print the private key if the quiet flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
moncho committed Nov 23, 2018
1 parent bcf1efb commit 33c5537
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"os"
"strings"
Expand All @@ -13,8 +14,13 @@ import (
"github.com/moncho/warpwallet/warp"
)

var quiet bool

func main() {
flag.BoolVar(&quiet, "quiet", false, "just print the private key")
flag.BoolVar(&quiet, "q", false, "just print the private key (shorthand)")

flag.Parse()
piped := seedsFromPipe()
pass, salt := promptSeeds(piped)

Expand Down Expand Up @@ -46,7 +52,11 @@ func main() {
fmt.Printf("Could not generate QR code for pubAddress: %s", err.Error())
os.Exit(-1)
}
print(wif, wifQR.String(), pubAddress, pubAddressQR.String())
if quiet {
fmt.Println(wif)
} else {
print(wif, wifQR.String(), pubAddress, pubAddressQR.String())
}
}

func print(wif, wifQR, pubAddress, pubAddressQR string) {
Expand All @@ -62,7 +72,6 @@ func print(wif, wifQR, pubAddress, pubAddressQR string) {

for i, line := range pub {
fmt.Printf("%s\t\t%s\n", string(line), string(wif2[i]))

}
}

Expand Down

0 comments on commit 33c5537

Please sign in to comment.