allow multiple databeses on command line

This commit is contained in:
denk-mal 2015-06-23 11:40:54 +02:00
parent 1f6161132e
commit 0390c67c4d

View File

@ -52,7 +52,7 @@ int main(int argc, char** argv)
QCommandLineParser parser;
parser.setApplicationDescription(QCoreApplication::translate("main", "KeePassX - cross-platform password manager"));
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "filename of the password database to open (*.kdbx)"), "[filename]");
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "filename(s) of the password database(s) to open (*.kdbx)"), "[filename(s)]");
QCommandLineOption configOption("config",
QCoreApplication::translate("main", "path to a custom config file"),
@ -89,8 +89,8 @@ int main(int argc, char** argv)
QObject::connect(&app, SIGNAL(openFile(QString)), &mainWindow, SLOT(openDatabase(QString)));
if (!args.isEmpty()) {
QString filename = args[0];
for (int ii=0; ii < args.length(); ii++) {
QString filename = args[ii];
if (!filename.isEmpty() && QFile::exists(filename)) {
mainWindow.openDatabase(filename, parser.value(passwordOption), parser.value(keyfileOption));
}