Add support for annotations

This matches the taskwarrior task model for annotations.
This commit is contained in:
Dustin J. Mitchell
2021-10-26 22:33:14 -04:00
parent 7fe5553093
commit 4314b8bc2d
8 changed files with 173 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
use crate::argparse::{DescriptionMod, Modification};
use taskchampion::TaskMut;
use chrono::Utc;
use taskchampion::{Annotation, TaskMut};
/// Apply the given modification
pub(super) fn apply_modification(
@@ -41,5 +42,12 @@ pub(super) fn apply_modification(
task.set_wait(wait)?;
}
if let Some(ref ann) = modification.annotate {
task.add_annotation(Annotation {
entry: Utc::now(),
description: ann.into(),
})?;
}
Ok(())
}