1
mirror of https://github.com/rclone/rclone synced 2024-12-22 13:03:02 +01:00

fs: make --dump imply -vv (#5418)

This commit is contained in:
Alex Chen 2021-06-23 00:32:26 +08:00 committed by GitHub
parent 0cb973f127
commit e635f4c0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,6 +152,19 @@ func ParseHeaders(headers []string) []*fs.HTTPOption {
// SetFlags converts any flags into config which weren't straight forward // SetFlags converts any flags into config which weren't straight forward
func SetFlags(ci *fs.ConfigInfo) { func SetFlags(ci *fs.ConfigInfo) {
if dumpHeaders {
ci.Dump |= fs.DumpHeaders
fs.Logf(nil, "--dump-headers is obsolete - please use --dump headers instead")
}
if dumpBodies {
ci.Dump |= fs.DumpBodies
fs.Logf(nil, "--dump-bodies is obsolete - please use --dump bodies instead")
}
if ci.Dump != 0 && verbose < 2 && ci.LogLevel != fs.LogLevelDebug {
fs.Logf(nil, "Automatically setting -vv as --dump is enabled")
verbose = 2
}
if verbose >= 2 { if verbose >= 2 {
ci.LogLevel = fs.LogLevelDebug ci.LogLevel = fs.LogLevelDebug
} else if verbose >= 1 { } else if verbose >= 1 {
@ -197,15 +210,6 @@ func SetFlags(ci *fs.ConfigInfo) {
} }
} }
if dumpHeaders {
ci.Dump |= fs.DumpHeaders
fs.Logf(nil, "--dump-headers is obsolete - please use --dump headers instead")
}
if dumpBodies {
ci.Dump |= fs.DumpBodies
fs.Logf(nil, "--dump-bodies is obsolete - please use --dump bodies instead")
}
switch { switch {
case deleteBefore && (deleteDuring || deleteAfter), case deleteBefore && (deleteDuring || deleteAfter),
deleteDuring && deleteAfter: deleteDuring && deleteAfter: