add cmd: use .Default(true) for pin option.
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
Kevin Atkinson committed
Dec 3, 2016 at 23:39 UTC
0b8e03278505a6ffcfef5eb0eeae013122b7ce5b
1 file changed
+2
-6
core/commands/add.go
+2
-6
@@ -76,7 +76,7 @@ You can now refer to the added file in a gateway, like so:
76
cmds.BoolOption(wrapOptionName, "w", "Wrap files with a directory object."),
77
cmds.BoolOption(hiddenOptionName, "H", "Include files that are hidden. Only takes effect on recursive add."),
78
cmds.StringOption(chunkerOptionName, "s", "Chunking algorithm to use."),
79
- cmds.BoolOption(pinOptionName, "Pin this object when adding. Default: true."),
79
+ cmds.BoolOption(pinOptionName, "Pin this object when adding.").Default(true),
80
cmds.BoolOption(rawLeavesOptionName, "Use raw blocks for leaf nodes. (experimental)"),
81
},
82
PreRun: func(req cmds.Request) error {
@@ -135,13 +135,9 @@ You can now refer to the added file in a gateway, like so:
135
hidden, _, _ := req.Option(hiddenOptionName).Bool()
136
silent, _, _ := req.Option(silentOptionName).Bool()
137
chunker, _, _ := req.Option(chunkerOptionName).String()
138
- dopin, pin_found, _ := req.Option(pinOptionName).Bool()
138
+ dopin, _, _ := req.Option(pinOptionName).Bool()
139
rawblks, _, _ := req.Option(rawLeavesOptionName).Bool()
140
141
- if !pin_found { // default
142
- dopin = true
143
- }
144
-
141
if hash {
142
nilnode, err := core.NewNode(n.Context(), &core.BuildCfg{
143
//TODO: need this to be true or all files