OK, so it's not much more than "hello, world", but it just show how to
use std::env as well as Vec<String> and even has an actual condition
in it! It's almost like real programming now.
Oh, and of course there's the collect() call which showcases both an
iterator and the magic of rust's type inference here (telling
collect() to return a Vec<string>). So, there's quite a bit of rust
here, even for just a tiny block of code.
fn main() {
- println!("Hello, world!");
+ let args: Vec<String> = std::env::args().collect();
+ if args.len() < 2 {
+ eprintln!("Usage: {} <race-config.json>", args[0]);
+ std::process::exit(1);
+ }
}