shuffle code
parent
bfdeebb7a2
commit
1ce120a647
16
cmd/dump.go
16
cmd/dump.go
|
|
@ -19,6 +19,17 @@ func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisp
|
||||||
return err
|
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
|
var v interface{} = root
|
||||||
switch rootDisplay {
|
switch rootDisplay {
|
||||||
case DUMP_ALL:
|
case DUMP_ALL:
|
||||||
|
|
@ -29,11 +40,6 @@ func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisp
|
||||||
case DUMP_DONE:
|
case DUMP_DONE:
|
||||||
v = root.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)
|
b2, err := yaml.Marshal(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue