use pttodo.NewRootFromFiles in cli
This commit is contained in:
10
cmd/dump.go
10
cmd/dump.go
@@ -15,18 +15,10 @@ 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...)
|
||||||
|
|
||||||
for _, filepath := range filepaths {
|
|
||||||
subroot, err := pttodo.NewRootFromFile(filepath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
subroot.MoveScheduledToTodo()
|
|
||||||
root.MergeIn(subroot)
|
|
||||||
}
|
|
||||||
|
|
||||||
root.MoveScheduledToTodo()
|
|
||||||
|
|
||||||
var v interface{} = root
|
var v interface{} = root
|
||||||
switch rootDisplay {
|
switch rootDisplay {
|
||||||
|
|||||||
Reference in New Issue
Block a user