From e119cee66cfcb7afd50bb6d6d8d1332ccb342ed1 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 18 Nov 2012 17:42:52 +0100 Subject: [PATCH] Don't emit warnings on unknown options --- lib/Slic3r/Config.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 0bf7d7e95..3e1a612af 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -985,8 +985,12 @@ sub set { } if (!exists $Options->{$opt_key}) { - $opt_key = +(grep { $Options->{$_}{aliases} && grep $_ eq $opt_key, @{$Options->{$_}{aliases}} } keys %$Options)[0] - or warn "Unknown option $opt_key\n"; + my @keys = grep { $Options->{$_}{aliases} && grep $_ eq $opt_key, @{$Options->{$_}{aliases}} } keys %$Options; + if (!@keys) { + warn "Unknown option $opt_key\n"; + return; + } + $opt_key = $keys[0]; } # clone arrayrefs