Commit 1b50fcef authored by Jeromy's avatar Jeromy

default add progress to false, unless using CLI

License: MIT
Signed-off-by: default avatarJeromy <why@ipfs.io>
parent 149819f8
...@@ -68,7 +68,7 @@ You can now refer to the added file in a gateway, like so: ...@@ -68,7 +68,7 @@ You can now refer to the added file in a gateway, like so:
cmds.OptionRecursivePath, // a builtin option that allows recursive paths (-r, --recursive) cmds.OptionRecursivePath, // a builtin option that allows recursive paths (-r, --recursive)
cmds.BoolOption(quietOptionName, "q", "Write minimal output.").Default(false), cmds.BoolOption(quietOptionName, "q", "Write minimal output.").Default(false),
cmds.BoolOption(silentOptionName, "Write no output.").Default(false), cmds.BoolOption(silentOptionName, "Write no output.").Default(false),
cmds.BoolOption(progressOptionName, "p", "Stream progress data.").Default(true), cmds.BoolOption(progressOptionName, "p", "Stream progress data."),
cmds.BoolOption(trickleOptionName, "t", "Use trickle-dag format for dag generation.").Default(false), cmds.BoolOption(trickleOptionName, "t", "Use trickle-dag format for dag generation.").Default(false),
cmds.BoolOption(onlyHashOptionName, "n", "Only chunk and hash - do not write to disk.").Default(false), cmds.BoolOption(onlyHashOptionName, "n", "Only chunk and hash - do not write to disk.").Default(false),
cmds.BoolOption(wrapOptionName, "w", "Wrap files with a directory object.").Default(false), cmds.BoolOption(wrapOptionName, "w", "Wrap files with a directory object.").Default(false),
...@@ -81,6 +81,11 @@ You can now refer to the added file in a gateway, like so: ...@@ -81,6 +81,11 @@ You can now refer to the added file in a gateway, like so:
return nil return nil
} }
_, found, _ := req.Option(progressOptionName).Bool()
if !found {
req.SetOption(progressOptionName, true)
}
sizeFile, ok := req.Files().(files.SizeFile) sizeFile, ok := req.Files().(files.SizeFile)
if !ok { if !ok {
// we don't need to error, the progress bar just won't know how big the files are // we don't need to error, the progress bar just won't know how big the files are
......
...@@ -343,7 +343,7 @@ test_add_cat_5MB ...@@ -343,7 +343,7 @@ test_add_cat_5MB
test_add_cat_expensive test_add_cat_expensive
test_add_named_pipe " Post http://$API_ADDR/api/v0/add?encoding=json&r=true&stream-channels=true:" test_add_named_pipe " Post http://$API_ADDR/api/v0/add?encoding=json&progress=true&r=true&stream-channels=true:"
test_kill_ipfs_daemon test_kill_ipfs_daemon
......
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