tidy up bitsy-validate

This commit is contained in:
Max Bradbury 2020-07-01 16:21:27 +01:00
parent 3104db32e2
commit d53d1d73d0
1 changed files with 3 additions and 5 deletions

View File

@ -2,12 +2,10 @@ extern crate bitsy_parser;
use bitsy_parser::game::Game; use bitsy_parser::game::Game;
use std::{env, fs}; use std::{env, fs};
const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`";
fn main() { fn main() {
let input_file = env::args() let input_file = env::args().nth(1).expect(SYNTAX_ERROR);
.nth(1)
.expect("No input path specified. Usage: `bitsy-validate filepath`");
Game::from(fs::read_to_string(input_file).unwrap()).unwrap(); Game::from(fs::read_to_string(input_file).unwrap()).unwrap();
println!("OK!"); println!("OK!");
} }