Validation for --duplicate-grid and --bed-size

This commit is contained in:
Alessandro Ranellucci 2012-04-11 17:52:06 +02:00
parent 0b29ad123e
commit 134595fc99

View File

@ -626,6 +626,20 @@ sub validate {
die "Invalid value for --scale\n" die "Invalid value for --scale\n"
if $Slic3r::scale <= 0; if $Slic3r::scale <= 0;
# --bed-size
die "Invalid value for --bed-size\n"
if !ref $Slic3r::bed_size
&& (!$Slic3r::bed_size || $Slic3r::bed_size !~ /^\d+,\d+$/);
$Slic3r::bed_size = [ split /,/, $Slic3r::bed_size ]
if !ref $Slic3r::bed_size;
# --duplicate-grid
die "Invalid value for --duplicate-grid\n"
if !ref $Slic3r::duplicate_grid
&& (!$Slic3r::duplicate_grid || $Slic3r::duplicate_grid !~ /^\d+,\d+$/);
$Slic3r::duplicate_grid = [ split /,/, $Slic3r::duplicate_grid ]
if !ref $Slic3r::duplicate_grid;
# --duplicate # --duplicate
die "Invalid value for --duplicate or --duplicate-grid\n" die "Invalid value for --duplicate or --duplicate-grid\n"
if !$Slic3r::duplicate || $Slic3r::duplicate < 1 || !$Slic3r::duplicate_grid if !$Slic3r::duplicate || $Slic3r::duplicate < 1 || !$Slic3r::duplicate_grid