Is there a problem with QCommandLineParser and filename wildcards in Windows?
I'm using Qt 5.8.0 opensource on Windows to build a console application. I'm trying to build a command line utility that accepts filename wildcards. This doesn't seem to work, as it bails on the process() method.
main.cpp:
#include <QCoreApplication>
#include <QCommandLineParser>
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
QCommandLineParser parser;
parser.addPositionalArgument("files", "input files", "[file]...");
parser.process(app);
QStringList posargs = parser.positionalArguments();
foreach(QString s, posargs)
cout << s.toStdString() << endl;
return EXIT_SUCCESS;
}
myapp.pro
CONFIG += c++14 console release
QT -= gui
sources = main.cpp
When I use the command:
myapp somefile.txt
I get somefile.txt
But this does not work with the command:
myapp *.txt
What's the best way around this?