feat: add command to list pomodoro

man-page
Moritz Böhme 2023-07-29 16:02:42 +02:00
parent 98acf3c74e
commit 61b7bd447d
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
3 changed files with 7 additions and 1 deletions

View File

@ -76,6 +76,9 @@ pub enum PomodoroCommand {
/// Stop the pomodoro
#[clap(visible_alias="p")]
Remove,
/// List the pomodoro settings and remaining duration
#[clap(visible_alias="l")]
List,
}
fn get_stream(socket_path: &String) -> Result<UnixStream> {

View File

@ -23,6 +23,7 @@ pub enum Command {
pauses_till_long: u64,
},
PomodoroRemove,
PomodoroList,
}
#[derive(Debug, Serialize, Deserialize)]
@ -148,7 +149,8 @@ impl Daemon {
Command::PomodoroRemove => {
self.pomodoro = None;
Ok(Answer::Ok)
},
}
Command::PomodoroList => Ok(Answer::Pomodoro(self.pomodoro.clone())),
}
}

View File

@ -31,6 +31,7 @@ fn main() -> Result<()> {
pauses_till_long,
},
PomodoroCommand::Remove => DaemonCommand::PomodoroRemove,
PomodoroCommand::List => DaemonCommand::PomodoroList,
},
};
send_command(&args.socket, daemon_command)