Commit db0ec2d6 authored by David Faure's avatar David Faure
Browse files

Add support for converting positional arguments

parent 60ec5092
......@@ -195,7 +195,11 @@ foreach my $file (@ARGV) {
$negatedOptions{$name} = 1;
}
my $translate = defined $use_tr ? "QCoreApplication::translate($context, $description)" : "$i18n($description)";
$_ = "${prefix}parser.addOption(QCommandLineOption(QStringList() << ${short}QLatin1String(\"$name\"), $translate$trail));\n";
if ($name =~ s/^\+//) {
$_ = "${prefix}parser.addPositionalArgument(QLatin1String(\"$name\"), $translate$trail);\n";
} else {
$_ = "${prefix}parser.addOption(QCommandLineOption(QStringList() << ${short}QLatin1String(\"$name\"), $translate$trail));\n";
}
$needQCommandLineOption = 1;
$short = "";
} elsif (/KCmdLineArgs\s*\*\s*(\w*)\s*=\s*KCmdLineArgs::parsedArgs\(\s*\)/) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment