mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
fix: Change filter string command
This commit is contained in:
parent
850ae7fbfc
commit
a512db47f9
1 changed files with 16 additions and 7 deletions
23
src/app.rs
23
src/app.rs
|
@ -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()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue