Skip to content

Commit

Permalink
Add check for valid monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
FieldofClay committed May 15, 2023
1 parent b853d33 commit 5c81677
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ fn main() -> Result<()> {
std::process::exit(0);
}
let mon = args[1].to_string();
if let None = Monitors::get()
.expect("unable to get monitors")
.find(|m| m.name == mon) {
println!("Unable to find monitor {mon}");
std::process::exit(0);
}
print_title(&mon);
// Create a event listener
let mut event_listener = EventListener::new();
Expand Down

0 comments on commit 5c81677

Please sign in to comment.