MCPcopy Create free account
hub / github.com/KDE/kdevelop / main

Function main

kdevplatform/util/duchainify/main.cpp:264–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262using namespace KDevelop;
263
264int main(int argc, char** argv)
265{
266 QCoreApplication app(argc, argv);
267
268 KAboutData aboutData(QStringLiteral("duchainify"), i18n("duchainify"),
269 QStringLiteral("1"), i18n("DUChain builder application"), KAboutLicense::GPL,
270 i18n("(c) 2009 David Nolden"), QString(), QStringLiteral("https://www.kdevelop.org/"));
271 KAboutData::setApplicationData(aboutData);
272
273 QCommandLineParser parser;
274 aboutData.setupCommandLine(&parser);
275
276 parser.addPositionalArgument(QStringLiteral("paths"), i18n("file or directory"), QStringLiteral("[PATH...]"));
277
278 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("w"), QStringLiteral("warnings")},
279 i18n("Show warnings")});
280 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("V"), QStringLiteral("verbose")},
281 i18n("Show warnings and debug output")});
282 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("u"), QStringLiteral("force-update")},
283 i18n("Enforce an update of the top-contexts corresponding to the given files")});
284 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("r"), QStringLiteral(
285 "force-update-recursive")},
286 i18n(
287 "Enforce an update of the top-contexts corresponding to the given files and all included files")});
288 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("t"), QStringLiteral("threads")},
289 i18n("Number of threads to use"), QStringLiteral("count")});
290 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("f"), QStringLiteral("features")},
291 i18n(
292 "Features to build. Options: empty, simplified-visible-declarations, visible-declarations (default), all-declarations, all-declarations-and-uses, all-declarations-and-uses-and-AST"),
293 QStringLiteral("features")});
294
295 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("dump-context")},
296 i18n("Print complete Definition-Use Chain on successful parse")});
297 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("dump-parent-contexts")},
298 i18n("Print parent contexts when dumping contexts")});
299 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("dump-definitions")},
300 i18n("Print complete DUChain Definitions repository on successful parse")});
301 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("dump-symboltable")},
302 i18n(
303 "Print complete DUChain PersistentSymbolTable repository on successful parse")});
304 parser.addOption(
305 QCommandLineOption { QStringList { QStringLiteral("dump-depth") },
306 i18n("Number defining the maximum depth where declaration details are printed"),
307 QStringLiteral("depth"), QStringLiteral("100") });
308 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("dump-graph")},
309 i18n("Dump DUChain graph (in .dot format)")});
310 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("d"), QStringLiteral("dump-errors")},
311 i18n("Print problems encountered during parsing")});
312 parser.addOption(QCommandLineOption{QStringList{QStringLiteral("dump-imported-errors")},
313 i18n("Recursively dump errors from imported contexts.")});
314
315 parser.process(app);
316
317 aboutData.processCommandLine(&parser);
318
319 verbose = parser.isSet(QStringLiteral("verbose"));
320 warnings = parser.isSet(QStringLiteral("warnings"));
321 qInstallMessageHandler(messageOutput);

Callers

nothing calls this directly

Calls 6

initializeFunction · 0.85
execMethod · 0.80
QStringClass · 0.50
initFunction · 0.50
processMethod · 0.45
isSetMethod · 0.45

Tested by

no test coverage detected