qt - How to proper use QCommandLineOption? -


how should use commandlineoption process command line arguments when arguments defined in string? example, if argument "p ttt" want 1 thing, if "p mmmm" need else. little test show nothing in debug. misunderstanding usage of these classes?

#include <qcoreapplication> #include <qcommandlineoption> #include <qcommandlineparser> #include <qdebug>  int main(int argc, char *argv[]) {    qcoreapplication a(argc, argv);    qcommandlineparser parser;      qcommandlineoption co({{"p","pp","t"}, "test option", "v1"});     parser.addoption(co);      parser.process ( (qstringlist() << "p --v1"));     qstring vv = parser.value("p");     qdebug() << vv;      return a.exec(); } 


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -