1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

filter: prevent mix opts when filesfrom is present - fixes #3599

This commit is contained in:
Michele Caci
2019-10-09 14:06:46 +02:00
committed by Nick Craig-Wood
parent bc45f6f952
commit 02c777ffbf
2 changed files with 57 additions and 10 deletions

View File

@@ -191,7 +191,12 @@ func NewFilter(opt *Opt) (f *Filter, err error) {
return nil, err
}
}
inActive := f.InActive()
for _, rule := range f.Opt.FilesFrom {
if !inActive {
return nil, fmt.Errorf("The usage of --files-from overrides all other filters, it should be used alone")
}
f.initAddFile() // init to show --files-from set even if no files within
err := forEachLine(rule, func(line string) error {
return f.AddFile(line)