fix: Change filter string command

This commit is contained in:
Dheepak Krishnamurthy 2021-12-06 11:37:06 -07:00
parent 850ae7fbfc
commit a512db47f9

View file

@ -1571,15 +1571,11 @@ 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 let Some(args) = shlex::split(&format!( task.arg(&format!(
r#"rc.report.{}.filter='{}'"#, r#""rc.report.{}.filter='{}'""#,
self.report, self.report,
self.filter.as_str().trim() 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 { if !self.current_context_filter.trim().is_empty() && self.task_version >= *LATEST_TASKWARRIOR_VERSION {
task.arg(self.current_context_filter.trim()); task.arg(self.current_context_filter.trim());
@ -1593,9 +1589,22 @@ impl TaskwarriorTui {
task.arg(&self.report); task.arg(&self.report);
} }
info!("Running `{:?}`", task);
debug!(
"Running `task {}`",
task.get_args()
.map(|s| s.to_string_lossy().to_string())
.collect::<Vec<String>>()
.join(" ")
);
let output = task.output()?; let output = task.output()?;
let data = String::from_utf8_lossy(&output.stdout); let data = String::from_utf8_lossy(&output.stdout);
let error = String::from_utf8_lossy(&output.stderr); 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 output.status.success() {
if let Ok(imported) = import(data.as_bytes()) { if let Ok(imported) = import(data.as_bytes()) {