summaryrefslogtreecommitdiff
path: root/src/watch/state.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-14 17:10:53 +0200
committermo8it <mo8it@proton.me>2024-04-14 17:10:53 +0200
commit1cbabc3d28a29a01caeffba969ed640e00e5f0be (patch)
tree4bed65819c4a05e1d9cb088d9b3fd969398143d8 /src/watch/state.rs
parentbd10b154fe558af693e9f8f57dbb3e43f0bd0ec8 (diff)
Add the manual-run option
Diffstat (limited to 'src/watch/state.rs')
-rw-r--r--src/watch/state.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs
index 1a79573..c0f6c53 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -18,10 +18,11 @@ pub struct WatchState<'a> {
stderr: Option<Vec<u8>>,
show_hint: bool,
show_done: bool,
+ manual_run: bool,
}
impl<'a> WatchState<'a> {
- pub fn new(app_state: &'a mut AppState) -> Self {
+ pub fn new(app_state: &'a mut AppState, manual_run: bool) -> Self {
let writer = io::stdout().lock();
Self {
@@ -31,6 +32,7 @@ impl<'a> WatchState<'a> {
stderr: None,
show_hint: false,
show_done: false,
+ manual_run,
}
}
@@ -78,6 +80,10 @@ impl<'a> WatchState<'a> {
fn show_prompt(&mut self) -> io::Result<()> {
self.writer.write_all(b"\n")?;
+ if self.manual_run {
+ self.writer.write_fmt(format_args!("{}un/", 'r'.bold()))?;
+ }
+
if self.show_done {
self.writer.write_fmt(format_args!("{}ext/", 'n'.bold()))?;
}