Merge branch 'flag-handling' into 'master'

Flag handling

See merge request mhart/DancingDroids!16
This commit is contained in:
Martin HART 2020-10-20 12:51:20 +02:00
commit 37f8df35ea
2 changed files with 14 additions and 0 deletions

View File

@ -7,3 +7,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
clap = "2.33.3"

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(())