mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 07:08:05 -05:00
bin/tau: change assign usage from key:value to @value
This commit is contained in:
@@ -83,18 +83,7 @@ pub fn apply_filter(tasks: &mut Vec<TaskInfo>, filter: &str) {
|
||||
}
|
||||
|
||||
// Filter by assignee(s).
|
||||
_ if filter.contains("assign:") => {
|
||||
let kv: Vec<&str> = filter.split(':').collect();
|
||||
if kv.len() == 2 {
|
||||
if let Some(value) = Value::from(kv[1]).as_str() {
|
||||
if value.is_empty() {
|
||||
tasks.retain(|task| task.assign.is_empty())
|
||||
} else {
|
||||
tasks.retain(|task| task.assign.contains(&value.to_string()))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_ if filter.starts_with('@') => tasks.retain(|task| task.assign.contains(&filter.into())),
|
||||
|
||||
// Filter by project(s).
|
||||
_ if filter.contains("project:") => {
|
||||
|
||||
@@ -173,6 +173,10 @@ pub fn task_from_cli(values: Vec<String>) -> Result<BaseTask> {
|
||||
tags.push(field[0].into());
|
||||
continue
|
||||
}
|
||||
if field[0].starts_with('@') {
|
||||
assign.push(field[0].into());
|
||||
continue
|
||||
}
|
||||
title.push_str(field[0]);
|
||||
title.push(' ');
|
||||
continue
|
||||
@@ -190,10 +194,6 @@ pub fn task_from_cli(values: Vec<String>) -> Result<BaseTask> {
|
||||
desc = Some(field[1].into());
|
||||
}
|
||||
|
||||
if field[0] == "assign" {
|
||||
assign = field[1].split(',').map(|s| s.into()).collect();
|
||||
}
|
||||
|
||||
if field[0] == "due" {
|
||||
due = due_as_timestamp(field[1])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user