diff --git a/src/app.rs b/src/app.rs index 7a123da..6d08a56 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1571,15 +1571,11 @@ impl TaskwarriorTui { task.arg("rc.json.array=on"); task.arg("rc.confirmation=off"); - if let Some(args) = shlex::split(&format!( - r#"rc.report.{}.filter='{}'"#, + task.arg(&format!( + r#""rc.report.{}.filter='{}'""#, self.report, self.filter.as_str().trim() - )) { - for arg in args { - task.arg(arg); - } - } + )); if !self.current_context_filter.trim().is_empty() && self.task_version >= *LATEST_TASKWARRIOR_VERSION { task.arg(self.current_context_filter.trim()); @@ -1593,9 +1589,22 @@ impl TaskwarriorTui { task.arg(&self.report); } + info!("Running `{:?}`", task); + debug!( + "Running `task {}`", + task.get_args() + .map(|s| s.to_string_lossy().to_string()) + .collect::>() + .join(" ") + ); let output = task.output()?; let data = String::from_utf8_lossy(&output.stdout); let error = String::from_utf8_lossy(&output.stderr); + if !error.is_empty() { + error!("{}", error) + } else if !data.is_empty() { + debug!("{}", data) + } if output.status.success() { if let Ok(imported) = import(data.as_bytes()) {