mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-11 11:19:05 +08:00
Merge pull request #3025 from ipfs/fix/progress-defaults
default add progress to false, unless using CLI
This commit is contained in:
commit
33510a9a29
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user