MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / processProgramOptions

Function processProgramOptions

src/App/Application.cpp:2586–2723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2584}
2585
2586void processProgramOptions(const boost::program_options::variables_map& vm, std::map<std::string,std::string>& mConfig)
2587{
2588 if (vm.contains("version") && !vm.contains("verbose")) {
2589 std::stringstream str;
2590 str << mConfig["ExeName"] << " " << mConfig["ExeVersion"]
2591 << " Revision: " << mConfig["BuildRevision"] << '\n';
2592 if (vm.count("verbose")) {
2593 App::ProgramInformation::getVerboseCommonInfo(str, mConfig);
2594 }
2595 throw Base::ProgramInformation(str.str());
2596 }
2597
2598 if (vm.contains("module-path")) {
2599 auto Mods = vm["module-path"].as< std::vector<std::string> >();
2600 std::string temp;
2601 for (const auto & It : Mods)
2602 temp += It + ";";
2603 temp.erase(temp.end()-1);
2604 mConfig["AdditionalModulePaths"] = temp;
2605 }
2606
2607 if (vm.contains("macro-path")) {
2608 std::vector<std::string> Macros = vm["macro-path"].as< std::vector<std::string> >();
2609 std::string temp;
2610 for (const auto & It : Macros)
2611 temp += It + ";";
2612 temp.erase(temp.end()-1);
2613 mConfig["AdditionalMacroPaths"] = std::move(temp);
2614 }
2615
2616 if (vm.contains("python-path")) {
2617 auto Paths = vm["python-path"].as< std::vector<std::string> >();
2618 for (const auto & It : Paths)
2619 Base::Interpreter().addPythonPath(It.c_str());
2620 }
2621
2622 if (vm.contains("disable-addon")) {
2623 auto Addons = vm["disable-addon"].as< std::vector<std::string> >();
2624 std::string temp;
2625 for (const auto & It : Addons) {
2626 temp += It + ";";
2627 }
2628 temp.erase(temp.end()-1);
2629 mConfig["DisabledAddons"] = temp;
2630 }
2631
2632 if (vm.contains("input-file")) {
2633 auto files(vm["input-file"].as< std::vector<std::string> >());
2634 int OpenFileCount=0;
2635 for (const auto & It : files) {
2636
2637 std::ostringstream temp;
2638 temp << "OpenFile" << OpenFileCount;
2639 mConfig[temp.str()] = It;
2640 OpenFileCount++;
2641 }
2642 std::ostringstream buffer;
2643 buffer << OpenFileCount;

Callers 1

initConfigMethod · 0.85

Calls 11

addPythonPathMethod · 0.80
substrMethod · 0.80
moveFunction · 0.50
containsMethod · 0.45
countMethod · 0.45
strMethod · 0.45
eraseMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected