MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / main

Function main

source/utility/map_grep.cpp:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94int main(int argc, char* argv[]) {
95 try {
96 RootLoader rootLoader({{}, {}, {}, LogLevel::Warn, false, {}});
97 rootLoader.setSummary("Search Tiled map files for specific materials or objects.");
98 rootLoader.addArgument("MaterialId|ObjectName|Property=Value", OptionParser::Required);
99 rootLoader.addArgument("JsonMapFile", OptionParser::Multiple);
100
101 RootUPtr root;
102 OptionParser::Options options;
103 tie(root, options) = rootLoader.commandInitOrDie(argc, argv);
104
105 SearchParameters search = {parseMatchCriteria(options.arguments[0])};
106 StringList files = options.arguments.slice(1);
107
108 for (auto file : files)
109 grepPath(search, file);
110
111 return 0;
112 } catch (std::exception const& e) {
113 cerrf("exception caught: {}\n", outputException(e, true));
114 return 1;
115 }
116}

Callers

nothing calls this directly

Calls 8

parseMatchCriteriaFunction · 0.85
grepPathFunction · 0.85
cerrfFunction · 0.85
setSummaryMethod · 0.80
addArgumentMethod · 0.80
commandInitOrDieMethod · 0.80
outputExceptionFunction · 0.50
sliceMethod · 0.45

Tested by

no test coverage detected