Skip to content

Commit 0b8e032

Browse files
committed
add cmd: use .Default(true) for pin option.
License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
1 parent aa97a09 commit 0b8e032

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/commands/add.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ You can now refer to the added file in a gateway, like so:
7676
cmds.BoolOption(wrapOptionName, "w", "Wrap files with a directory object."),
7777
cmds.BoolOption(hiddenOptionName, "H", "Include files that are hidden. Only takes effect on recursive add."),
7878
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),
8080
cmds.BoolOption(rawLeavesOptionName, "Use raw blocks for leaf nodes. (experimental)"),
8181
},
8282
PreRun: func(req cmds.Request) error {
@@ -135,13 +135,9 @@ You can now refer to the added file in a gateway, like so:
135135
hidden, _, _ := req.Option(hiddenOptionName).Bool()
136136
silent, _, _ := req.Option(silentOptionName).Bool()
137137
chunker, _, _ := req.Option(chunkerOptionName).String()
138-
dopin, pin_found, _ := req.Option(pinOptionName).Bool()
138+
dopin, _, _ := req.Option(pinOptionName).Bool()
139139
rawblks, _, _ := req.Option(rawLeavesOptionName).Bool()
140140

141-
if !pin_found { // default
142-
dopin = true
143-
}
144-
145141
if hash {
146142
nilnode, err := core.NewNode(n.Context(), &core.BuildCfg{
147143
//TODO: need this to be true or all files

0 commit comments

Comments
 (0)