1
0
Fork 0

Add exit option to statechange dialog

This commit is contained in:
Malte Brandy 2018-07-23 21:05:25 +02:00
parent ce3dd5c5f1
commit fa9222cef6
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -360,6 +360,7 @@ Do you want to change the state? (Esc to cancel)",
"idle: I am not interested in doing anything",
"idle"
),
("exit: Leave the state as it is", "exit"),
],
)? {
"work" => self.state.mode = Mode::Work,
@ -371,6 +372,7 @@ Do you want to change the state? (Esc to cancel)",
"idle" => self.state.mode = Mode::Idle,
"uni" => self.state.location = Location::Uni,
"anywhere" => self.state.location = Location::Anywhere,
"exit" => return Ok(()),
other => bail!("Unkown option {}", other),
};
save_state(&self.state)?;