Cleanup the --output-filename-format implementation. #53 #137

This commit is contained in:
Alessandro Ranellucci 2011-12-26 17:20:26 +01:00
parent 1071b556cb
commit f9446b9c6e
5 changed files with 79 additions and 40 deletions

View file

@ -10,7 +10,7 @@ our $Options = {
# output options
'output_filename_format' => {
label => 'Output filename format',
cli => 'output=s',
cli => 'output-filename-format=s',
type => 's',
},
@ -296,6 +296,14 @@ sub set {
${"Slic3r::$opt_key"} = $value;
}
sub serialize {
my $class = @_ == 2 ? shift : undef;
my ($opt_key) = @_;
return $Options->{$opt_key}{serialize}
? $Options->{$opt_key}{serialize}->(get($opt_key))
: get($opt_key);
}
sub save {
my $class = shift;
my ($file) = @_;