Add flags

This commit is contained in:
Martin HART 2020-10-20 12:48:28 +02:00
parent 1bd216c50b
commit 861001a2e1
1 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,4 @@
use clap::{App, Arg};
use std::fs;
use std::io;
@ -111,6 +112,18 @@ fn open_file(filename: &str) -> io::Result<String> {
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let matches = App::new("DancingDroids")
.version("0.1.0")
.about("When droids dance togethers")
.arg(
Arg::with_name("file")
.short("f")
.long("file")
.takes_value(true)
.help("Configuration file"),
)
.get_matches();
let mut robot_pool: Vec<Robot> = Vec::new();
let raw_conf = open_file("two_robots.txt")?;
Ok(())