diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index fa89ee18d..9dcc73236 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -115,13 +115,18 @@ sub do_slice { $process_dialog->Pulse; my $skein = Slic3r::Skein->new( input_file => $input_file, + output_file => $main::opt{output}, ); $skein->go; $process_dialog->Destroy; undef $process_dialog; - Wx::MessageDialog->new($self, "$input_file_basename was successfully sliced.", 'Done!', - wxOK | wxICON_INFORMATION)->ShowModal; + if (!$main::opt{close_after_slicing}) { + Wx::MessageDialog->new($self, "$input_file_basename was successfully sliced.", 'Done!', + wxOK | wxICON_INFORMATION)->ShowModal; + } else { + $self->GetParent->Destroy(); # quit + } }; $self->catch_error(sub { $process_dialog->Destroy if $process_dialog }); } diff --git a/slic3r.pl b/slic3r.pl index e60c85d4c..3b3aa5093 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -12,12 +12,13 @@ use Getopt::Long; use Slic3r; use XXX; -my %opt; +our %opt; GetOptions( 'help' => sub { usage() }, 'debug' => \$Slic3r::debug, - 'o|output' => \$opt{output}, + 'o|output=s' => \$opt{output}, + 'close-after-slicing' => \$opt{close_after_slicing}, 'save=s' => \$opt{save}, 'load=s' => \$opt{load},