feat: add command to list pomodoro
parent
98acf3c74e
commit
61b7bd447d
|
@ -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> {
|
||||
|
|
|
@ -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())),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ fn main() -> Result<()> {
|
|||
pauses_till_long,
|
||||
},
|
||||
PomodoroCommand::Remove => DaemonCommand::PomodoroRemove,
|
||||
PomodoroCommand::List => DaemonCommand::PomodoroList,
|
||||
},
|
||||
};
|
||||
send_command(&args.socket, daemon_command)
|
||||
|
|
Loading…
Reference in New Issue