Make --output accept directories. #535

degen-loop-screen
Henrik Brix Andersen 2012-08-01 17:12:16 +02:00
parent deaa188630
commit 0e620f3ad2
3 changed files with 8 additions and 4 deletions

View File

@ -87,8 +87,8 @@ The author of the Silk icon set is Mark James.
--save <file> Save configuration to the specified file
--load <file> Load configuration from the specified file. It can be used
more than once to load options from multiple files.
-o, --output <file> File to output gcode to (by default, the file will be saved
into the same directory as the input file using the
-o, --output <file> File or directory to output gcode to (by default, the file will be
saved into the same directory as the input file using the
--output-filename-format to generate the filename)
-j, --threads <num> Number of threads to use (1+, default: 2)

View File

@ -775,6 +775,10 @@ sub expanded_output_filepath {
my $self = shift;
my ($path) = @_;
# if output path is an existing directory, we take that and append
# the specified filename format
$path = File::Spec->join($path, $Slic3r::Config->output_filename_format) if ($path && -d $path);
# if no explicit output file was defined, we take the input
# file directory and append the specified filename format
my $input_file = $self->objects->[0]->input_file;

View File

@ -11,10 +11,10 @@ _arguments -S \
'(- *)--version[output the version of Slic3r and exit]' \
'--save[save configuration to file]:config output file:_files -g "*.(#i)ini(-.)"' \
'*--load[load configuration from file]:config input file:_files -g "*.(#i)ini(-.)"' \
'(--output -o --output-filename-format)'{--output,-o}'[specify output file]:output file:_files -g "*.(#i)(gcode|svg)(-.)"' \
'(--output -o)'{--output,-o}'[specify output file]:output file:_files -g "*.(#i)(gcode|svg)(-.)"' \
'(--threads -j)'{--threads,-j}'[specify number of threads to use]:number of threads' \
\
'(--output -o)--output-filename-format[specify output filename format]:output filename format' \
'--output-filename-format[specify output filename format]:output filename format' \
'*--post-process[specify post-processing script]:post-processing script file:_files' \
'--export-svg[export SVG containing slices instead of G-code]' \
'(--merge -m)'{--merge,-m}'[merge multiple input files into a single print]' \