MCPcopy Create free account
hub / github.com/chigraph/chigraph / get

Function get

chi/get.cpp:15–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using namespace chi;
14
15int get(const std::vector<std::string>& opts) {
16 po::options_description get_options("get options");
17 get_options.add_options()("module", po::value<std::vector<std::string>>(), "Modules to get")(
18 "workspace,w", po::value<std::string>()->default_value(fs::current_path().string()),
19 "The workspace path. Leave blank to inferr from the working directory");
20
21 po::positional_options_description pos;
22 pos.add("module", -1);
23
24 po::variables_map vm;
25 po::store(po::command_line_parser(opts).options(get_options).positional(pos).run(), vm);
26
27 if (vm.count("module") == 0) {
28 std::cerr << "no input files" << std::endl;
29 return 1;
30 }
31 auto modules = vm["module"].as<std::vector<std::string>>();
32
33 Context ctx{vm["workspace"].as<std::string>()};
34 Result res;
35
36 for (const auto& mod : modules) { res += ctx.fetchModule(mod, true); }
37
38 std::cout << res << std::endl;
39 if (!res) { return 1; }
40 return 0;
41}

Callers 8

codegenMethod · 0.85
codegenMethod · 0.85
LangModuleMethod · 0.85
functionTypeMethod · 0.85
codegenNodeFunction · 0.85
compileFunctionFunction · 0.85
dataTypeMethod · 0.85
mainFunction · 0.85

Calls 1

fetchModuleMethod · 0.80

Tested by

no test coverage detected