Browse Source

Add compatibility between test and graph

main
raffitz 3 years ago
parent
commit
449ddc6ae6
Signed by: raffitz
GPG Key ID: BB3596BD0A31252D
  1. 1
      .gitignore
  2. 2
      Cargo.lock
  3. 2
      Cargo.toml
  4. 13
      src/main.rs

1
.gitignore vendored

@ -5,3 +5,4 @@
*/*.csv */*.csv
*/*.txt */*.txt
*/*.gv */*.gv
*.gv

2
Cargo.lock generated

@ -311,7 +311,7 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "voxelmap" name = "voxelmap"
version = "0.3.2" version = "0.3.3"
dependencies = [ dependencies = [
"clap", "clap",
"lodepng", "lodepng",

2
Cargo.toml

@ -1,6 +1,6 @@
[package] [package]
name = "voxelmap" name = "voxelmap"
version = "0.3.2" version = "0.3.3"
authors = ["raffitz <raf.a.m.c.gon@gmail.com>"] authors = ["raffitz <raf.a.m.c.gon@gmail.com>"]
edition = "2018" edition = "2018"
description = "Converts mathematical descriptions of objects to voxel maps" description = "Converts mathematical descriptions of objects to voxel maps"

13
src/main.rs

@ -109,8 +109,7 @@ fn main() -> Result<(), error::Error> {
.long("graph") .long("graph")
.help("Output graph of internal state") .help("Output graph of internal state")
.takes_value(false) .takes_value(false)
.multiple(false) .multiple(false),
.conflicts_with("test"),
) )
.arg( .arg(
Arg::with_name("test") Arg::with_name("test")
@ -177,7 +176,7 @@ fn main() -> Result<(), error::Error> {
let test = matches.is_present("test"); let test = matches.is_present("test");
let output_folder = if test { let output_folder = if test {
"" "."
} else { } else {
matches.value_of("OUTPUT_DIR").unwrap() matches.value_of("OUTPUT_DIR").unwrap()
}; };
@ -272,10 +271,6 @@ fn main() -> Result<(), error::Error> {
println!("\n{:?}", tree); println!("\n{:?}", tree);
} }
if test {
return Ok(());
}
// Print graph // Print graph
if graph { if graph {
let mut gv_file = fs::File::create(format! {"{}/state.gv",output_folder})?; let mut gv_file = fs::File::create(format! {"{}/state.gv",output_folder})?;
@ -304,6 +299,10 @@ fn main() -> Result<(), error::Error> {
writeln!(gv_file, "}}")?; writeln!(gv_file, "}}")?;
} }
if test {
return Ok(());
}
let min_x: i64 = min_x.unwrap(); let min_x: i64 = min_x.unwrap();
let max_x: i64 = max_x.unwrap(); let max_x: i64 = max_x.unwrap();
let min_y: i64 = min_y.unwrap(); let min_y: i64 = min_y.unwrap();

Loading…
Cancel
Save