Address code review.
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
Kevin Atkinson committed
Aug 21, 2018 at 22:48 UTC
b0f90e3e848380344dbe8d456784114b6a977356
2 files changed
+7
-6
core/commands/add.go
+6
-5
@@ -46,7 +46,7 @@ const (
46
cidVersionOptionName = "cid-version"
47
hashOptionName = "hash"
48
inlineOptionName = "inline"
49
- idHashLimitOptionName = "id-hash-limit"
49
+ inlineLimitOptionName = "inline-limit"
50
)
51
52
const adderOutChanSize = 8
@@ -123,8 +123,8 @@ You can now check what blocks have been created by:
123
cmdkit.BoolOption(fstoreCacheOptionName, "Check the filestore for pre-existing blocks. (experimental)"),
124
cmdkit.IntOption(cidVersionOptionName, "CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. (experimental)"),
125
cmdkit.StringOption(hashOptionName, "Hash function to use. Implies CIDv1 if not sha2-256. (experimental)").WithDefault("sha2-256"),
126
- cmdkit.BoolOption(inlineOptionName, "Inline small objects using identity hash. (experimental)"),
127
- cmdkit.IntOption(idHashLimitOptionName, "Identity hash maxium size. (experimental)").WithDefault(64),
126
+ cmdkit.BoolOption(inlineOptionName, "Inline small blocks into CIDs. (experimental)"),
127
+ cmdkit.IntOption(inlineLimitOptionName, "Maximum block size to inline. (experimental)").WithDefault(64),
128
},
129
PreRun: func(req *cmds.Request, env cmds.Environment) error {
130
quiet, _ := req.Options[quietOptionName].(bool)
@@ -179,7 +179,7 @@ You can now check what blocks have been created by:
179
cidVer, cidVerSet := req.Options[cidVersionOptionName].(int)
180
hashFunStr, _ := req.Options[hashOptionName].(string)
181
inline, _ := req.Options[inlineOptionName].(bool)
182
- idHashLimit, _ := req.Options[idHashLimitOptionName].(int)
182
+ inlineLimit, _ := req.Options[inlineLimitOptionName].(int)
183
184
// The arguments are subject to the following constraints.
185
//
@@ -291,7 +291,8 @@ You can now check what blocks have been created by:
291
if inline {
292
fileAdder.CidBuilder = cidutil.InlineBuilder{
293
Builder: fileAdder.CidBuilder,
294
- Limit: idHashLimit}
294
+ Limit: inlineLimit,
295
+ }
296
}
297
298
if hash {
test/sharness/t0040-add-and-cat.sh
+1
-1
@@ -590,7 +590,7 @@ test_add_cat_expensive "--cid-version=1" "zdj7WcatQrtuE4WMkS4XsfsMixuQN2po4irkYh
590
# encoded with the blake2b-256 hash funtion
591
test_add_cat_expensive '--hash=blake2b-256' "zDMZof1kwndounDzQCANUHjiE3zt1mPEgx7RE3JTHoZrRRa79xcv"
592
593
-test_add_named_pipe " Post http://$API_ADDR/api/v0/add?chunker=size-262144&encoding=json&hash=sha2-256&id-hash-limit=64&pin=true&progress=true&recursive=true&stream-channels=true:"
593
+test_add_named_pipe " Post http://$API_ADDR/api/v0/add?chunker=size-262144&encoding=json&hash=sha2-256&inline-limit=64&pin=true&progress=true&recursive=true&stream-channels=true:"
594
595
test_add_pwd_is_symlink
596