Changeset View
Changeset View
Standalone View
Standalone View
src/cli/kate-syntax-highlighter.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 42 | { | |||
---|---|---|---|---|---|
87 | QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"), | 87 | QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"), | ||
88 | app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used.")); | 88 | app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used.")); | ||
89 | parser.addOption(stdinOption); | 89 | parser.addOption(stdinOption); | ||
90 | 90 | | |||
91 | parser.process(app); | 91 | parser.process(app); | ||
92 | 92 | | |||
93 | Repository repo; | 93 | Repository repo; | ||
94 | if (parser.isSet(listDefs)) { | 94 | if (parser.isSet(listDefs)) { | ||
95 | foreach (const auto &def, repo.definitions()) { | 95 | for (const auto &def : repo.definitions()) { | ||
96 | std::cout << qPrintable(def.name()) << std::endl; | 96 | std::cout << qPrintable(def.name()) << std::endl; | ||
97 | } | 97 | } | ||
98 | return 0; | 98 | return 0; | ||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | if (parser.isSet(listThemes)) { | 101 | if (parser.isSet(listThemes)) { | ||
102 | foreach (const auto &theme, repo.themes()) | 102 | for (const auto &theme : repo.themes()) | ||
103 | std::cout << qPrintable(theme.name()) << std::endl; | 103 | std::cout << qPrintable(theme.name()) << std::endl; | ||
104 | return 0; | 104 | return 0; | ||
105 | } | 105 | } | ||
106 | 106 | | |||
107 | if (parser.isSet(updateDefs)) { | 107 | if (parser.isSet(updateDefs)) { | ||
108 | DefinitionDownloader downloader(&repo); | 108 | DefinitionDownloader downloader(&repo); | ||
109 | QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { | 109 | QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { | ||
110 | std::cout << qPrintable(msg) << std::endl; | 110 | std::cout << qPrintable(msg) << std::endl; | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |