Questions tagged [qcommandlineparser]

The QCommandLineParser class provides a means for handling the command line options.

The QCommandLineParser class provides a means for handling the command line options.QCommandLineParser is an integrated way to treat command line options.

16 questions
10
votes
1 answer

How to use QCommandLineParser for arguments with multiple params?

I wonder, how can I use multiple- or sub-arguments with QCommandLineParser? For example: /home/my_app --my_option_with_two_params first_param second_param --my-option-with-one-param param?
VALOD9
  • 566
  • 2
  • 6
  • 22
3
votes
1 answer

QCommandLineParser adding functionality to arguments

I'm newbie to Qt Framework and I'm using QCommandLineParser to write a simple console application that could handle some arguments such as : myapp.exe start or myapp.exe get update How can i understand that user entered an argument ? i want to add…
3
votes
6 answers

Parse command line arguments/options in C#

I have a console application with some arguments and options so I would like to use a free third-party library. I have found two libraries for this purpose: NDesk.Options and Command Line Parser Library Finally I have decided to use Command Line…
Willy
  • 9,848
  • 22
  • 141
  • 284
3
votes
0 answers

QCommandLineParser: suspend execution if built-in options were processed

I am developing a Qt 5.x application whose main function is more or less like that (simplified): int main(int argc, char *argv[]) { QApplication app(arg, argv); QCommandLineParser cmdLineParser; cmdLineParser.addHelpOption(); …
Morix Dev
  • 2,700
  • 1
  • 28
  • 49
2
votes
1 answer

QCommandLineOption: How to parse the same parameter multiple times?

I'm trying to parse multiple times the same parameter with QCommandLineParser. The thing is that when I try to parse them, it returns me an empty QStringList, which means that parser encountered some kind of error, even though those are correctly…
Majork
  • 23
  • 6
1
vote
0 answers

Unable to parse error options in CommandLineParser

I am using commandLineParser version 2.5.0 https://github.com/commandlineparser/commandline/wiki. If there is an error, I am unable to parse which command line options are invalid. I can only find out the type of error from Current.Tag. How do I…
0
votes
0 answers

Default value for QCommandLineOption

I'm working with QCommandLineParser but I'm not sure how to handle the defaultValue of an option. This is the snippet I have so far: QCommandLineParser parser; parser.setApplicationDescription("Video Grabber and…
Buzz
  • 1,102
  • 1
  • 9
  • 24
0
votes
0 answers

How to reference a specific overloaded QCommandLineParser.process() in Python?

Qt5 provides two functions to process command line arguments in QCommandLineParser class. The signatures are: process(const QStringList &arguments) process(const QCoreApplication &app) This works fine in C++ but Python has no overloading feature…
ajlittoz
  • 414
  • 1
  • 5
  • 14
0
votes
0 answers

How to Write SCM Command programmatically in java

Here is the scm command : lscm show Operations -u fgh4jor -P 56yuiop -r localhost Now my motive is that how to call above scm command programmatically in java ? Is it Possible? Thanks in advance!!
Rajat Krishnan
  • 111
  • 2
  • 9
0
votes
1 answer

How do I pass an instantiation of QCommandLineParser to a function in Qt?

Currently I have a working Qt command line application. However, I need to refactor this working program such that my QCommandLineParser object gets configured in a class method rather than in main() itself. I have tried the obvious: In…
developer01
  • 311
  • 2
  • 6
  • 20
0
votes
2 answers

How to use filename wildcards with QCommandLineParser

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…
JimmyG
  • 131
  • 1
  • 9
0
votes
1 answer

qt5 QCommandLineParser required values

I have this code: parser.addOption(requiredValueOption); parser.addOption(booleanOption); if (!parser.parse(app->arguments())) { qDebug() << parser.errorText(); parser.showHelp(1); } When I call it like this: ./app --required-value-option…
Deep
  • 2,472
  • 2
  • 15
  • 25
0
votes
1 answer

QCommandLineOption reading input files

I'm working on a code using QCommandLineOption to read input files (jpg files in this case). I'm trying to wrap my head around how to properly add the filepath & names to it to access the datas, but it doesn't work. Here's the code : #include…
user4810918
0
votes
0 answers

Accepting a complete command as a command line argument

I'm writing a utility that accepts a secondary shell command as its final parameter. My utility then runs the supplied shell command on behalf of the user. The user will invoke it as follows: util [options] command with args I want…
0
votes
1 answer

Pass multiple parsing values to addPositionalArgument function

I was looking on how to parse the command line arguments. I found this: // A boolean option with multiple names (-f, --force) QCommandLineOption forceOption(QStringList() << "f" << "force", QCoreApplication::translate("main", "Overwrite…
Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474
1
2