Commit 33510a9a authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #3025 from ipfs/fix/progress-defaults

default add progress to false, unless using CLI
parents 8d3a7772 1b50fcef
......@@ -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.BoolOption(quietOptionName, "q", "Write minimal 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(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),
......@@ -81,6 +81,11 @@ You can now refer to the added file in a gateway, like so:
return nil
}
_, found, _ := req.Option(progressOptionName).Bool()
if !found {
req.SetOption(progressOptionName, true)
}
sizeFile, ok := req.Files().(files.SizeFile)
if !ok {
// 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
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
......
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