6int main(
int argc,
char **argv)
9 QCommandLineParser parser;
12 bool verbose = parser.isSet(
"verbose");
18 QCoreApplication app(argc, argv);
19 QCommandLineParser parser;
20 QCommandLineOption verboseOption(
"verbose");
21 parser.addOption(verboseOption);
23 bool verbose = parser.isSet(verboseOption);
28 QCommandLineParser parser;
34 parser.addPositionalArgument(
"file", QCoreApplication::translate(
"main",
"The file to open."));
40 parser.addPositionalArgument(
"urls", QCoreApplication::translate(
"main",
"URLs to open, optionally."),
"[urls...]");
47 parser.addPositionalArgument(
"source", QCoreApplication::translate(
"main",
"Source file to copy."));
48 parser.addPositionalArgument(
"destination", QCoreApplication::translate(
"main",
"Destination directory."));
54 QCoreApplication app(argc, argv);
55 QCommandLineParser parser;
57 parser.addPositionalArgument(
"command",
"The command to execute.");
60 parser.parse(QCoreApplication::arguments());
62 const QStringList args = parser.positionalArguments();
63 const QString command = args.isEmpty() ? QString() : args.first();
64 if (command ==
"resize") {
65 parser.clearPositionalArguments();
66 parser.addPositionalArgument(
"resize",
"Resize the object to a new size.",
"resize [resize_options]");
67 parser.addOption(QCommandLineOption(
"size",
"New size.",
"new_size"));
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89