Skip to content

Commit

Permalink
allow running multiple commands seperated by semicolon
Browse files Browse the repository at this point in the history
  • Loading branch information
Icerath committed Jan 11, 2025
1 parent 4b46620 commit 681743d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ fn main() {
let mut app = Application::default();

if let Some(run) = args.message {
let Some(msg) = UciMessage::parse(run.trim()) else {
panic!("Invalid message: {run}");
};
app.process_message(msg, true);
for section in run.split(';').map(str::trim) {
if section.is_empty() {
continue;
}
let Some(msg) = UciMessage::parse(section.trim()) else {
panic!("Invalid message: '{section}'");
};
app.process_message(msg, true);
}
return;
}

Expand Down

0 comments on commit 681743d

Please sign in to comment.