mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-24 02:51:38 -08:00
Adding --no-password option to CLI
I also added tests for the --key-file option, which was untested.
This commit is contained in:
1 parent
a58e3d5ee0
commit
13a9ac8f57
20 files changed
+146
-20
No files matched your search
@@ -50,6 +50,7 @@ int Add::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 username(QStringList() << "u"
|
||||
<< "username",
|
||||
@@ -91,6 +92,7 @@ int Add::execute(const QStringList& arguments)
|
||||
const QString& entryPath = args.at(1);
|
||||
|
||||
auto db = Utils::unlockDatabase(databasePath,
|
||||
!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