mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 14:36:42 +02:00
Merge pull request #500 from kdheepak/show-error-spawn-for-task-shortcut
Show error message when spawn fails for task_shortcut
This commit is contained in:
commit
13f5680c47
5 changed files with 23 additions and 22 deletions
|
@ -48,7 +48,7 @@ use tui::{
|
||||||
layout::{Alignment, Constraint, Direction, Layout, Margin, Rect},
|
layout::{Alignment, Constraint, Direction, Layout, Margin, Rect},
|
||||||
style::{Color, Modifier, Style},
|
style::{Color, Modifier, Style},
|
||||||
terminal::Frame,
|
terminal::Frame,
|
||||||
text::{Span, Line, Text},
|
text::{Line, Span, Text},
|
||||||
widgets::{Block, BorderType, Borders, Clear, Gauge, LineGauge, List, ListItem, Paragraph, Wrap},
|
widgets::{Block, BorderType, Borders, Clear, Gauge, LineGauge, List, ListItem, Paragraph, Wrap},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1887,7 +1887,8 @@ impl TaskwarriorTui {
|
||||||
for i in cmd.iter().skip(1) {
|
for i in cmd.iter().skip(1) {
|
||||||
command.arg(i);
|
command.arg(i);
|
||||||
}
|
}
|
||||||
if let Ok(child) = command.spawn() {
|
match command.spawn() {
|
||||||
|
Ok(child) => {
|
||||||
let output = child.wait_with_output();
|
let output = child.wait_with_output();
|
||||||
match output {
|
match output {
|
||||||
Ok(o) => {
|
Ok(o) => {
|
||||||
|
@ -1905,8 +1906,8 @@ impl TaskwarriorTui {
|
||||||
}
|
}
|
||||||
Err(s) => Err(format!("`{}` failed to wait with output: {}", shell, s)),
|
Err(s) => Err(format!("`{}` failed to wait with output: {}", shell, s)),
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
Err(format!("`{}` failed: Unable to spawn shortcut number {}", shell, s))
|
Err(err) => Err(format!("`{}` failed: Unable to spawn shortcut number {} - Error: {}", shell, s, err)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => Err(format!("Unable to run shortcut number {}: shlex::split(`{}`) failed.", s, shell)),
|
None => Err(format!("Unable to run shortcut number {}: shlex::split(`{}`) failed.", s, shell)),
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::{error::Error, io};
|
||||||
use tui::{
|
use tui::{
|
||||||
layout::{Constraint, Corner, Direction, Layout},
|
layout::{Constraint, Corner, Direction, Layout},
|
||||||
style::{Color, Modifier, Style},
|
style::{Color, Modifier, Style},
|
||||||
text::{Span, Line},
|
text::{Line, Span},
|
||||||
widgets::{Block, Borders, List, ListItem, ListState},
|
widgets::{Block, Borders, List, ListItem, ListState},
|
||||||
Terminal,
|
Terminal,
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@ use tui::{
|
||||||
buffer::Buffer,
|
buffer::Buffer,
|
||||||
layout::{Alignment, Rect},
|
layout::{Alignment, Rect},
|
||||||
style::{Modifier, Style},
|
style::{Modifier, Style},
|
||||||
text::{Span, Line, Text},
|
text::{Line, Span, Text},
|
||||||
widgets::{Block, BorderType, Borders, Clear, Paragraph, Widget},
|
widgets::{Block, BorderType, Borders, Clear, Paragraph, Widget},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use tui::{
|
||||||
layout::{Alignment, Rect},
|
layout::{Alignment, Rect},
|
||||||
style::{Color, Modifier, Style},
|
style::{Color, Modifier, Style},
|
||||||
symbols,
|
symbols,
|
||||||
text::{Span, Line, Text},
|
text::{Line, Span, Text},
|
||||||
widgets::{Block, BorderType, Borders, Clear, Paragraph, StatefulWidget, Widget},
|
widgets::{Block, BorderType, Borders, Clear, Paragraph, StatefulWidget, Widget},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use tui::{
|
||||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||||
style::{Color, Modifier, Style},
|
style::{Color, Modifier, Style},
|
||||||
symbols,
|
symbols,
|
||||||
text::{Span, Line},
|
text::{Line, Span},
|
||||||
widgets::{Block, BorderType, Borders, Cell, LineGauge, Paragraph, Row, Table},
|
widgets::{Block, BorderType, Borders, Cell, LineGauge, Paragraph, Row, Table},
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue