mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 12:17:19 +02:00
fix: Allow using --report=all 🐛
This commit is contained in:
parent
f59462fda7
commit
f94d25f7df
2 changed files with 19 additions and 17 deletions
32
src/app.rs
32
src/app.rs
|
@ -1568,15 +1568,15 @@ impl TaskwarriorTui {
|
||||||
task.arg("rc.json.array=on");
|
task.arg("rc.json.array=on");
|
||||||
task.arg("rc.confirmation=off");
|
task.arg("rc.confirmation=off");
|
||||||
|
|
||||||
if self.task_version >= *LATEST_TASKWARRIOR_VERSION {
|
if !self.filter.as_str().trim().is_empty() && self.task_version >= *LATEST_TASKWARRIOR_VERSION {
|
||||||
task.arg(format!("'{}'", self.filter.as_str().trim()));
|
task.arg(format!("'{}'", self.filter.as_str().trim()));
|
||||||
} else {
|
} else if !self.filter.as_str().trim().is_empty() {
|
||||||
task.arg(self.filter.as_str().trim());
|
task.arg(self.filter.as_str().trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.current_context_filter.is_empty() && self.task_version >= *LATEST_TASKWARRIOR_VERSION {
|
if !self.current_context_filter.trim().is_empty() && self.task_version >= *LATEST_TASKWARRIOR_VERSION {
|
||||||
task.arg(format!("'{}'", self.current_context_filter.trim()));
|
task.arg(format!("'{}'", self.current_context_filter.trim()));
|
||||||
} else if !self.current_context_filter.is_empty() {
|
} else if !self.current_context_filter.trim().is_empty() {
|
||||||
task.arg(format!("'\\({}\\)'", self.current_context_filter));
|
task.arg(format!("'\\({}\\)'", self.current_context_filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4401,18 +4401,6 @@ mod tests {
|
||||||
test_case(&expected);
|
test_case(&expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[test]
|
|
||||||
fn test_app() {
|
|
||||||
let mut app = TaskwarriorTui::new("next").unwrap();
|
|
||||||
|
|
||||||
app.update(true).unwrap();
|
|
||||||
|
|
||||||
let backend = TestBackend::new(80, 20);
|
|
||||||
let mut terminal = Terminal::new(backend).unwrap();
|
|
||||||
app.render(&mut terminal).unwrap();
|
|
||||||
println!("{}", buffer_view(terminal.backend().buffer()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// #[test]
|
// #[test]
|
||||||
fn test_graphemes() {
|
fn test_graphemes() {
|
||||||
dbg!("写作业".graphemes(true).count());
|
dbg!("写作业".graphemes(true).count());
|
||||||
|
@ -4445,4 +4433,16 @@ mod tests {
|
||||||
let position = TaskwarriorTui::get_position(&app.modify);
|
let position = TaskwarriorTui::get_position(&app.modify);
|
||||||
dbg!(position);
|
dbg!(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #[test]
|
||||||
|
fn test_app() {
|
||||||
|
let mut app = TaskwarriorTui::new("all").unwrap();
|
||||||
|
|
||||||
|
app.update(true).unwrap();
|
||||||
|
|
||||||
|
let backend = TestBackend::new(80, 20);
|
||||||
|
let mut terminal = Terminal::new(backend).unwrap();
|
||||||
|
app.render(&mut terminal).unwrap();
|
||||||
|
println!("{}", buffer_view(terminal.backend().buffer()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -398,7 +398,9 @@ impl Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_filter(data: &str, report: &str) -> Result<String> {
|
fn get_filter(data: &str, report: &str) -> Result<String> {
|
||||||
if let Some(s) = Self::get_config(
|
if report == "all" {
|
||||||
|
Ok("".into())
|
||||||
|
} else if let Some(s) = Self::get_config(
|
||||||
format!("uda.taskwarrior-tui.task-report.{}.filter", report).as_str(),
|
format!("uda.taskwarrior-tui.task-report.{}.filter", report).as_str(),
|
||||||
data,
|
data,
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue