Support CLI syntax for changing tags
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::argparse::{DescriptionMod, Modification};
|
||||
use failure::Fallible;
|
||||
use std::convert::TryInto;
|
||||
use taskchampion::TaskMut;
|
||||
use termcolor::WriteColor;
|
||||
|
||||
@@ -32,6 +33,18 @@ pub(super) fn apply_modification<W: WriteColor>(
|
||||
task.stop()?;
|
||||
}
|
||||
|
||||
for tag in modification.add_tags.iter() {
|
||||
// note that the parser should have already ensured that this tag was valid
|
||||
let tag = tag.try_into()?;
|
||||
task.add_tag(&tag)?;
|
||||
}
|
||||
|
||||
for tag in modification.remove_tags.iter() {
|
||||
// note that the parser should have already ensured that this tag was valid
|
||||
let tag = tag.try_into()?;
|
||||
task.remove_tag(&tag)?;
|
||||
}
|
||||
|
||||
write!(w, "modified task {}\n", task.get_uuid())?;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user