flag rename

This commit is contained in:
Volodymyr Patuta 2020-11-08 14:22:27 +01:00
parent b24d023f1a
commit a91eefaf41
1 changed files with 4 additions and 4 deletions

View File

@ -241,15 +241,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.help("Generate random world"), .help("Generate random world"),
) )
.arg( .arg(
Arg::with_name("gen-world") Arg::with_name("random")
.short("g") .short("r")
.long("gen-world") .long("random")
.takes_value(false) .takes_value(false)
.help("Generate random world with 2 random robots"), .help("Generate random world with 2 random robots"),
) )
.get_matches(); .get_matches();
let mut robot_pool: Vec<robot::Robot> = Vec::new(); let mut robot_pool: Vec<robot::Robot> = Vec::new();
let world = match matches.is_present("gen-world") { let world = match matches.is_present("random") {
true => gen_world(&mut robot_pool), true => gen_world(&mut robot_pool),
false => { false => {
let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?; let raw_conf = open_file(matches.value_of("file").unwrap_or("two_robots.txt"))?;