use pttodo.NewRootFromFiles in cli

master
Bel LaPointe 2023-11-06 12:58:46 -07:00
parent bfcec9d1c5
commit 39345e5e2a
1 changed files with 3 additions and 11 deletions

View File

@ -15,19 +15,11 @@ func dump(config config) error {
} }
func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisplay string) error { func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisplay string) error {
var root pttodo.Root root, err := pttodo.NewRootFromFiles(filepaths...)
if err != nil {
for _, filepath := range filepaths { return err
subroot, err := pttodo.NewRootFromFile(filepath)
if err != nil {
return err
}
subroot.MoveScheduledToTodo()
root.MergeIn(subroot)
} }
root.MoveScheduledToTodo()
var v interface{} = root var v interface{} = root
switch rootDisplay { switch rootDisplay {
case DUMP_ALL: case DUMP_ALL: