mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-13 08:19:50 -05:00
Fix quiet option for Merge (CLI) (#2695)
This commit is contained in:
parent
8cf3ee866e
commit
fa3c959212
@ -78,7 +78,10 @@ int Merge::execute(const QStringList& arguments)
|
|||||||
|
|
||||||
QSharedPointer<Database> db2;
|
QSharedPointer<Database> db2;
|
||||||
if (!parser.isSet("same-credentials")) {
|
if (!parser.isSet("same-credentials")) {
|
||||||
db2 = Utils::unlockDatabase(args.at(1), parser.value(keyFileFromOption), Utils::STDOUT, Utils::STDERR);
|
db2 = Utils::unlockDatabase(args.at(1),
|
||||||
|
parser.value(keyFileFromOption),
|
||||||
|
parser.isSet(Command::QuietOption) ? Utils::DEVNULL : Utils::STDOUT,
|
||||||
|
Utils::STDERR);
|
||||||
if (!db2) {
|
if (!db2) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -883,6 +883,14 @@ void TestCli::testMerge()
|
|||||||
mergeCmd.execute({"merge", "-q", "-s", sourceFile.fileName(), sourceFile.fileName()});
|
mergeCmd.execute({"merge", "-q", "-s", sourceFile.fileName(), sourceFile.fileName()});
|
||||||
m_stdoutFile->seek(pos);
|
m_stdoutFile->seek(pos);
|
||||||
QCOMPARE(m_stdoutFile->readAll(), QByteArray(""));
|
QCOMPARE(m_stdoutFile->readAll(), QByteArray(""));
|
||||||
|
|
||||||
|
// Quiet option without the -s option
|
||||||
|
pos = m_stdoutFile->pos();
|
||||||
|
Utils::Test::setNextPassword("a");
|
||||||
|
Utils::Test::setNextPassword("a");
|
||||||
|
mergeCmd.execute({"merge", "-q", sourceFile.fileName(), sourceFile.fileName()});
|
||||||
|
m_stdoutFile->seek(pos);
|
||||||
|
QCOMPARE(m_stdoutFile->readAll(), QByteArray(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCli::testRemove()
|
void TestCli::testRemove()
|
||||||
|
Loading…
Reference in New Issue
Block a user