Commit 013d98a3 authored by Brian Tiger Chow's avatar Brian Tiger Chow Committed by Juan Batiz-Benet

fix(2/init, 2/add) fix optionvalue signature

parent 3493e33e
......@@ -27,25 +27,25 @@ var initCmd = &cmds.Command{
},
Run: func(req cmds.Request) (interface{}, error) {
dspath, err := req.Option("d").String()
dspathOverride, _, err := req.Option("d").String() // if !found it's okay. Let == ""
if err != nil {
return nil, err
}
force, err := req.Option("f").Bool()
force, _, err := req.Option("f").Bool() // if !found, it's okay force == false
if err != nil {
return nil, err
}
nBitsForKeypair, err := req.Option("b").Int()
nBitsForKeypair, bitsOptFound, err := req.Option("b").Int()
if err != nil {
return nil, err
}
if !req.Option("b").Found() {
if !bitsOptFound {
nBitsForKeypair = 4096
}
return nil, doInit(req.Context().ConfigRoot, dspath, force, nBitsForKeypair)
return nil, doInit(req.Context().ConfigRoot, dspathOverride, force, nBitsForKeypair)
},
}
......
......@@ -45,7 +45,7 @@ remains to be implemented.
added := &AddOutput{}
n := req.Context().Node
recursive, err := req.Option("r").Bool()
recursive, _, err := req.Option("r").Bool()
if err != nil {
return nil, err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment