mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-29 01:06:27 -05:00
allow multiple databeses on command line
This commit is contained in:
parent
1f6161132e
commit
0390c67c4d
@ -52,7 +52,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.setApplicationDescription(QCoreApplication::translate("main", "KeePassX - cross-platform password manager"));
|
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",
|
QCommandLineOption configOption("config",
|
||||||
QCoreApplication::translate("main", "path to a custom config file"),
|
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)));
|
QObject::connect(&app, SIGNAL(openFile(QString)), &mainWindow, SLOT(openDatabase(QString)));
|
||||||
|
|
||||||
if (!args.isEmpty()) {
|
for (int ii=0; ii < args.length(); ii++) {
|
||||||
QString filename = args[0];
|
QString filename = args[ii];
|
||||||
if (!filename.isEmpty() && QFile::exists(filename)) {
|
if (!filename.isEmpty() && QFile::exists(filename)) {
|
||||||
mainWindow.openDatabase(filename, parser.value(passwordOption), parser.value(keyfileOption));
|
mainWindow.openDatabase(filename, parser.value(passwordOption), parser.value(keyfileOption));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user