Adding --no-password option to CLI
I also added tests for the --key-file option, which was untested.
This commit is contained in:
@@ -49,6 +49,7 @@ int Clip::execute(const QStringList& arguments)
|
||||
parser.addPositionalArgument("database", QObject::tr("Path of the database."));
|
||||
parser.addOption(Command::QuietOption);
|
||||
parser.addOption(Command::KeyFileOption);
|
||||
parser.addOption(Command::NoPasswordOption);
|
||||
|
||||
QCommandLineOption totp(QStringList() << "t"
|
||||
<< "totp",
|
||||
@@ -67,6 +68,7 @@ int Clip::execute(const QStringList& arguments)
|
||||
}
|
||||
|
||||
auto db = Utils::unlockDatabase(args.at(0),
|
||||
!parser.isSet(Command::NoPasswordOption),
|
||||
parser.value(Command::KeyFileOption),
|
||||
parser.isSet(Command::QuietOption) ? Utils::DEVNULL : Utils::STDOUT,
|
||||
Utils::STDERR);
|
||||
|
||||
Reference in New Issue
Block a user