mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'src/exe/mod.rs')
-rw-r--r--src/exe/mod.rs33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/exe/mod.rs b/src/exe/mod.rs
index e56922a..aa49f29 100644
--- a/src/exe/mod.rs
+++ b/src/exe/mod.rs
@@ -1,23 +1,19 @@
mod draw;
mod map;
-mod print;
macro_rules! print_err {
- ($err:expr, $($msg:tt)*) => {
- {
- use std::error::Error;
- let err = $err;
- eprint!($($msg)*);
- eprintln!(": {err}");
- let mut err_ref = &err as &dyn Error;
- loop
- {
- if let Some(next) = err_ref.source()
- {
- eprintln!("\tSource: {next}");
- err_ref = next;
- }
- else {break;}
+ ($err:expr, $($msg:tt)*) => {{
+ use std::error::Error;
+ let err = $err;
+ eprint!($($msg)*);
+ eprintln!(": {err}");
+ let mut err_ref = &err as &dyn Error;
+ loop {
+ let Some(next) = err_ref.source() else {
+ break;
+ };
+ eprintln!("\tSource: {next}");
+ err_ref = next;
}
}
};
@@ -28,10 +24,9 @@ fn main() {
let mut args = std::env::args();
args.next().unwrap(); // path to executable
match args.next() {
- None => eprintln!("Not enough arguments, valid commands are: draw, print"),
- Some(s) if s == "print" => print::main(args),
+ None => eprintln!("Not enough arguments, valid commands are: draw, map"),
Some(s) if s == "draw" => draw::main(args),
Some(s) if s == "map" => map::main(args),
- Some(s) => eprintln!("Unknown argument {s}, valid commands are: draw, print"),
+ Some(s) => eprintln!("Unknown argument {s}, valid commands are: draw, map"),
}
}