Skip to content

Commit

Permalink
Incorporate review from @Kubuxu
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Justin Drake <drakefjustin@gmail.com>
  • Loading branch information
JustinDrake committed Jul 31, 2017
1 parent be8e8b2 commit d2ba362
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
namesys "github.com/ipfs/go-ipfs/namesys"
config "github.com/ipfs/go-ipfs/repo/config"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"

ci "gx/ipfs/QmaPbCnUMBohSGo3KnxEa2bHqyJVVeEEcwtqJAYxerieBo/go-libp2p-crypto"
)

Expand Down Expand Up @@ -52,7 +53,7 @@ environment variable:
},
Options: []cmds.Option{
cmds.IntOption("bits", "b", "Number of bits to use in the generated RSA private key.").Default(nBitsForKeypairDefault),
cmds.IntOption("key-type", "k", "Key type (RSA or Ed25519-id").Default(ci.RSA),
cmds.IntOption("key-type", "k", "Key type (RSA or Ed25519-id").Default(keypairTypeDefault),
cmds.BoolOption("empty-repo", "e", "Don't add and pin help files to the local storage.").Default(false),
cmds.StringOption("profile", "p", "Apply profile settings to config. Multiple profiles can be separated by ','"),

Expand Down Expand Up @@ -82,19 +83,19 @@ environment variable:
return
}

empty, _, err := req.Option("e").Bool()
empty, _, err := req.Option("empty-repo").Bool()
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}

nBitsForKeypair, _, err := req.Option("b").Int()
nBitsForKeypair, _, err := req.Option("bits").Int()
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}

keyType, _, err := req.Option("k").Int()
keyType, _, err := req.Option("key-type").Int()
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
Expand Down

0 comments on commit d2ba362

Please sign in to comment.