mirror of
https://github.com/arcan1s/queued.git
synced 2025-07-19 00:29:55 +00:00
add task helper
This commit is contained in:
@ -42,13 +42,13 @@ int main(int argc, char *argv[])
|
||||
// info
|
||||
QCommandLineOption infoOption(QStringList() << "i"
|
||||
<< "info",
|
||||
"Show additional info.");
|
||||
"Shows additional info.");
|
||||
parser.addOption(infoOption);
|
||||
|
||||
// debug mode
|
||||
QCommandLineOption debugOption(QStringList() << "d"
|
||||
<< "debug",
|
||||
"Print debug information.");
|
||||
"Prints debug information.");
|
||||
parser.addOption(debugOption);
|
||||
|
||||
// configuration option
|
||||
@ -63,6 +63,10 @@ int main(int argc, char *argv[])
|
||||
"user", ::getlogin());
|
||||
parser.addOption(userOption);
|
||||
|
||||
// additional help option
|
||||
QCommandLineOption commandsOption("commands", "Lists available commands.");
|
||||
parser.addOption(commandsOption);
|
||||
|
||||
parser.addPositionalArgument("command", "Command to execute.", "<command>");
|
||||
|
||||
// pre-parse
|
||||
@ -80,6 +84,12 @@ int main(int argc, char *argv[])
|
||||
QDebug(QtMsgType::QtInfoMsg).noquote() << string;
|
||||
return 0;
|
||||
}
|
||||
if (parser.isSet(commandsOption)) {
|
||||
QDebug(QtMsgType::QtInfoMsg).noquote() << parser.helpText();
|
||||
QDebug(QtMsgType::QtInfoMsg).noquote()
|
||||
<< QueuedctlCommon::commandsHelp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// enable debug
|
||||
if (parser.isSet(debugOption))
|
||||
|
Reference in New Issue
Block a user