PDA

View Full Version : Problem about argument of console app



madawg
1st October 2018, 10:46
I used QCommandLineParser to parse app's agrument


QCommandLineParser parser;
parser.parse(qApp->arguments());
const QStringList args = parser.positionalArguments();
input:
./app arg1 -a opt1 => args = arg1, opt1
./app arg -a opt1 arg1 => args = opt1, arg1

but I need: args only has the argument without the value of the option.

Ginsengelf
1st October 2018, 11:05
Hi, do you use QCommandLineParser?

Ginsengelf

madawg
1st October 2018, 11:36
Sure. I will edit question.

Added after 12 minutes:

I setup addOptipns and addPositionArgument after.
Thanks so much!