filter: fix --min-age and --max-age together check
Somehow in the code reorganisation of
11da2a6c9b
the check for --min-age and
--max-age got switched around. This commit fixes that and means you
can use --min-age and --max-age together.
This commit is contained in:
parent
a703216286
commit
764440068e
1 changed files with 1 additions and 1 deletions
|
@ -130,7 +130,7 @@ func NewFilter(opt *Opt) (f *Filter, err error) {
|
||||||
}
|
}
|
||||||
if f.Opt.MaxAge.IsSet() {
|
if f.Opt.MaxAge.IsSet() {
|
||||||
f.ModTimeFrom = time.Now().Add(-time.Duration(f.Opt.MaxAge))
|
f.ModTimeFrom = time.Now().Add(-time.Duration(f.Opt.MaxAge))
|
||||||
if !f.ModTimeTo.IsZero() && f.ModTimeFrom.Before(f.ModTimeTo) {
|
if !f.ModTimeTo.IsZero() && f.ModTimeTo.Before(f.ModTimeFrom) {
|
||||||
log.Fatal("filter: --min-age can't be larger than --max-age")
|
log.Fatal("filter: --min-age can't be larger than --max-age")
|
||||||
}
|
}
|
||||||
fs.Debugf(nil, "--max-age %v to %v", f.Opt.MaxAge, f.ModTimeFrom)
|
fs.Debugf(nil, "--max-age %v to %v", f.Opt.MaxAge, f.ModTimeFrom)
|
||||||
|
|
Loading…
Add table
Reference in a new issue