diff --git a/cmd/dump.go b/cmd/dump.go index 9ab2937..64aa4d1 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -19,6 +19,17 @@ func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisp return err } + for _, x := range []*[]pttodo.Todo{ + &root.Todo, + &root.Scheduled, + &root.Done, + } { + y := pttodo.Todos(*x) + y = y.LikeTags(tags) + y = y.LikeSearch(search) + *x = y + } + var v interface{} = root switch rootDisplay { case DUMP_ALL: @@ -29,11 +40,6 @@ func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisp case DUMP_DONE: v = root.Done } - if todos, ok := v.([]pttodo.Todo); ok { - todos = pttodo.Todos(todos).LikeTags(tags) - todos = pttodo.Todos(todos).LikeSearch(search) - v = todos - } b2, err := yaml.Marshal(v) if err != nil {