summaryrefslogtreecommitdiffstats
path: root/src/actions/modify.rs
blob: 449d95a630ac92f43d5b08496d3a9446592bdbf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use utils::fileutil as utils;

pub fn do_modify(lines: &mut Iterator<Item = String>, args: &[String]) {
  info!("do_modify");
  
  if args[0] == "removeprop" && args[1] == "xlicerror" {
    let cals = utils::read_calendars_from_files(lines).unwrap();
    let output: Vec<String> = cals.into_iter()
      .map(|cal| cal.with_remove_property("X-LIC-ERROR") )
      .filter(|cal| cal.1 > 0)
      .map(|cal| cal.0.to_string())
      .collect();
    println!("{}", output.join("\n"));
  } else {
    error!("not supported")
  }

}