38information from qmake projects and passes it to lupdate.
39All command line options that are not consumed by lupdate-pro are
40passed to lupdate.
41
42Options:
43 -help Display this information and exit.
44 -silent
45 Do not explain what is being done.
46 -pro <filename>
47 Name of a .pro file. Useful for files with .pro file syntax but
48 different file suffix. Projects are recursed into and merged.
49 -pro-out <directory>
50 Virtual output directory for processing subsequent .pro files.
51 -pro-debug
52 Trace processing .pro files. Specify twice for more verbosity.
53 -version
54 Display the version of lupdate-pro and exit.
55)"_s);
58int main(
int argc,
char **argv)
60 QCoreApplication app(argc, argv);
61#ifndef QT_BOOTSTRAPPED
63 QTranslator translator;
64 QTranslator qtTranslator;
65 QString sysLocale = QLocale::system().name();
66 QString resourceDir = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
67 if (translator.load(
"linguist_"_L1 + sysLocale, resourceDir)
68 && qtTranslator.load(
"qt_"_L1 + sysLocale, resourceDir)) {
69 app.installTranslator(&translator);
70 app.installTranslator(&qtTranslator);
75 QStringList args = app.arguments();
76 QStringList lupdateOptions;
77 QStringList lprodumpOptions;
78 bool hasProFiles =
false;
79 bool keepProjectDescription =
false;
81 for (
int i = 1; i < args.size(); ++i) {
82 QString arg = args.at(i);
83 if (arg ==
"-help"_L1 || arg ==
"--help"_L1 || arg ==
"-h"_L1) {
86 }
else if (arg ==
"-keep"_L1) {
87 keepProjectDescription =
true;
88 }
else if (arg ==
"-silent"_L1) {
89 lupdateOptions << arg;
90 lprodumpOptions << arg;
91 }
else if (arg ==
"-pro-debug"_L1) {
92 lprodumpOptions << arg;
93 }
else if (arg ==
"-version"_L1) {
94 printOut(QStringLiteral(
"lupdate-pro version %1\n").arg(QLatin1String(QT_VERSION_STR)));
96 }
else if (arg ==
"-pro"_L1) {
99 printErr(u"The -pro option should be followed by a filename of .pro file.\n"_s);
102 lprodumpOptions << arg << args[i];
104 }
else if (arg ==
"-pro-out"_L1) {
107 printErr(u"The -pro-out option should be followed by a directory name.\n"_s);
110 lprodumpOptions << arg << args[i];
111 }
else if (isProOrPriFile(arg)) {