if optional positional arg is todo/scheduled/done, then resolve first level

Bel LaPointe 2021-12-31 22:32:07 -05:00
parent 10b95672e3
commit 492e0af993
1 changed files with 11 additions and 1 deletions

View File

@ -137,7 +137,17 @@ func dump(dry bool, writer io.Writer, filepath string) error {
}
root.MoveScheduledToTodo()
b2, err := yaml.Marshal(root)
var v interface{} = root
switch flag.Arg(0) {
case "":
case "todo":
v = root.Todo
case "scheduled":
v = root.Scheduled
case "done":
v = root.Done
}
b2, err := yaml.Marshal(v)
if err != nil {
return err
}