Merge branch 'flag-handling' into 'master'
Flag handling See merge request mhart/DancingDroids!16
This commit is contained in:
commit
37f8df35ea
@ -7,3 +7,4 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
clap = "2.33.3"
|
||||||
|
13
src/main.rs
13
src/main.rs
@ -1,3 +1,4 @@
|
|||||||
|
use clap::{App, Arg};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
@ -111,6 +112,18 @@ fn open_file(filename: &str) -> io::Result<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
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 mut robot_pool: Vec<Robot> = Vec::new();
|
||||||
let raw_conf = open_file("two_robots.txt")?;
|
let raw_conf = open_file("two_robots.txt")?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user