mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 14:36:42 +02:00
Merge pull request #316 from kdheepak/fix-report-all
Allow using --report=all
This commit is contained in:
commit
ae51e928cf
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.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()));
|
||||
} else {
|
||||
} else if !self.filter.as_str().trim().is_empty() {
|
||||
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()));
|
||||
} else if !self.current_context_filter.is_empty() {
|
||||
} else if !self.current_context_filter.trim().is_empty() {
|
||||
task.arg(format!("'\\({}\\)'", self.current_context_filter));
|
||||
}
|
||||
|
||||
|
@ -4401,18 +4401,6 @@ mod tests {
|
|||
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]
|
||||
fn test_graphemes() {
|
||||
dbg!("写作业".graphemes(true).count());
|
||||
|
@ -4445,4 +4433,16 @@ mod tests {
|
|||
let position = TaskwarriorTui::get_position(&app.modify);
|
||||
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> {
|
||||
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(),
|
||||
data,
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue