parse add
This commit is contained in:
@@ -111,8 +111,18 @@ mod test_flags {
|
||||
}
|
||||
}
|
||||
|
||||
fn add(files: Vec<String>, add: String, add_schedule: Option<String>) -> Result<(), String> {
|
||||
Err("not impl".to_string())
|
||||
fn add(files: Vec<String>, added: String, add_schedule: Option<String>) -> Result<(), String> {
|
||||
let task = match add_schedule.clone() {
|
||||
None => serde_yaml::Value::String(added),
|
||||
Some(add_schedule) => {
|
||||
let mut m = serde_yaml::Mapping::new();
|
||||
m.insert("schedule".into(), add_schedule.into());
|
||||
m.insert("do".into(), added.into());
|
||||
serde_yaml::Value::Mapping(m)
|
||||
}
|
||||
};
|
||||
|
||||
panic!("append {:?} to {:?}", &task, &files);
|
||||
}
|
||||
|
||||
fn reconcile(files: Vec<String>) -> Result<(), String> {
|
||||
|
||||
Reference in New Issue
Block a user