mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-30 03:16:42 -05:00
CLI: Cleanup create options (#4313)
* Add ability to create database with an empty password * Add password repeat check * Standardize process between `db-create` and `import` commands * Improve db-create tests with new password repeat Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
parent
b045160e4f
commit
e6c2c7ed93
8 changed files with 171 additions and 54 deletions
|
|
@ -70,10 +70,12 @@ int Import::execute(const QStringList& arguments)
|
|||
|
||||
auto key = QSharedPointer<CompositeKey>::create();
|
||||
|
||||
auto password = Utils::getPasswordFromStdin();
|
||||
if (!password.isNull()) {
|
||||
key->addKey(password);
|
||||
auto passwordKey = Utils::getPasswordFromStdin();
|
||||
if (passwordKey.isNull()) {
|
||||
errorTextStream << QObject::tr("Failed to set database password.") << endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
key->addKey(passwordKey);
|
||||
|
||||
if (key->isEmpty()) {
|
||||
errorTextStream << QObject::tr("No key is set. Aborting database creation.") << endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue