From 0390c67c4d82a43ed97d5f8597bf8340532cc4be Mon Sep 17 00:00:00 2001 From: denk-mal Date: Tue, 23 Jun 2015 11:40:54 +0200 Subject: [PATCH] allow multiple databeses on command line --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c12517595..41df31c93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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)); }