diff options
Diffstat (limited to 'src/openscad.cc')
-rw-r--r-- | src/openscad.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/openscad.cc b/src/openscad.cc index ab84235..0fa9f92 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -33,6 +33,7 @@ #include "builtin.h" #include "printutils.h" #include "handle_dep.h" +#include "feature.h" #include "parsersettings.h" #include "rendersettings.h" #include "PlatformUtils.h" @@ -107,10 +108,12 @@ static void help(const char *progname) PRINTB("Usage: %1% [ -o output_file [ -d deps_file ] ]\\\n" "%2%[ -m make_command ] [ -D var=val [..] ] \\\n" + "%2%[ --version ] [ --info ] \\\n" "%2%[ --camera=translatex,y,z,rotx,y,z,dist | \\\n" "%2% --camera=eyex,y,z,centerx,y,z ] \\\n" "%2%[ --imgsize=width,height ] [ --projection=(o)rtho|(p)ersp] \\\n" "%2%[ --render | --preview[=throwntogether] ] \\\n" + "%2%[ --enable=<feature> ] \\\n" "%2%filename\n", progname % (const char *)tabstr); exit(1); @@ -203,7 +206,7 @@ int cmdline(const char *deps_output_file, const std::string &filename, Camera &c #else const std::string application_path = boosty::stringy(boosty::absolute(boost::filesystem::path(argv[0]).parent_path())); #endif - parser_init(application_path, false); + parser_init(application_path); Tree tree; #ifdef ENABLE_CGAL CGALEvaluator cgalevaluator(tree); @@ -513,7 +516,7 @@ int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, cha qexamplesdir = exdir.path(); } MainWindow::setExamplesDir(qexamplesdir); - parser_init(app_path.toLocal8Bit().constData(), true); + parser_init(app_path.toLocal8Bit().constData()); #ifdef Q_WS_MAC installAppleEventHandlers(); @@ -568,7 +571,6 @@ int main(int argc, char **argv) fs::path original_path = fs::current_path(); - const char *filename = NULL; const char *output_file = NULL; const char *deps_output_file = NULL; @@ -587,7 +589,8 @@ int main(int argc, char **argv) ("x,x", po::value<string>(), "dxf-file") ("d,d", po::value<string>(), "deps-file") ("m,m", po::value<string>(), "makefile") - ("D,D", po::value<vector<string> >(), "var=val"); + ("D,D", po::value<vector<string> >(), "var=val") + ("enable", po::value<vector<string> >(), "enable experimental features"); po::options_description hidden("Hidden options"); hidden.add_options() @@ -651,6 +654,11 @@ int main(int argc, char **argv) commandline_commands += ";\n"; } } + if (vm.count("enable")) { + BOOST_FOREACH(const string &feature, vm["enable"].as<vector<string> >()) { + Feature::enable_feature(feature); + } + } vector<string> inputFiles; if (vm.count("input-file")) { inputFiles = vm["input-file"].as<vector<string> >(); |