Skip to content

Commit

Permalink
Added default values for expected params in CLI::run (dont_arrange, l…
Browse files Browse the repository at this point in the history
…oad)
  • Loading branch information
zdroyer authored and lordofhyphens committed Apr 13, 2019
1 parent 14bae7f commit c8cfe0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/slic3r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int CLI::run(int argc, char **argv) {
if (cli_transform_config_def.has(opt_key)) this->transforms.push_back(opt_key);
}
// load config files supplied via --load
for (auto const &file : config.getStrings("load")) {
for (auto const &file : config.getStrings("load",{})) {
try{
if (!boost::filesystem::exists(file)) {
if (config.getBool("ignore_nonexistent_file", false)) {
Expand Down Expand Up @@ -314,10 +314,10 @@ int CLI::run(int argc, char **argv) {
boost::nowide::cout << msg << std::endl;
};
print.apply_config(this->print_config);
print.arrange = !this->config.getBool("dont_arrange");
print.arrange = !this->config.getBool("dont_arrange",false);
print.center = !this->config.has("center")
&& !this->config.has("align_xy")
&& !this->config.getBool("dont_arrange");
&& !this->config.getBool("dont_arrange",false);
Slic3r::Log::error("CLI") << "Arrange: " << print.arrange<< ", center: " << print.center << std::endl;
print.set_model(model);

Expand Down Expand Up @@ -435,7 +435,7 @@ CLI::output_filepath(const Model &model, IO::ExportFormat format) const {
const std::string filename = pp.process(filename_format);

// use --output when available
std::string outfile{ this->config.getString("output") };
std::string outfile{ this->config.getString("output","") };
if (!outfile.empty()) {
// if we were supplied a directory, use it and append our automatically generated filename
const boost::filesystem::path out(outfile);
Expand Down

0 comments on commit c8cfe0d

Please sign in to comment.