mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-27 20:36:49 -08:00
Adding top-level fields to CLI commands
The top-level fields are currently not accessible from the CLI, which makes it impossible to select entries or groups based on the UUID. There are other top-level fields I believe, like the expiry date, but I only added the two most critical fields for the moment.
This commit is contained in:
1 parent
e245701533
commit
e7e75c1277
6 files changed
+57
-4
No files matched your search
@@ -18,6 +18,7 @@
|
||||
#include "Utils.h"
|
||||
|
||||
#include "core/Database.h"
|
||||
#include "core/Entry.h"
|
||||
#include "core/EntryAttributes.h"
|
||||
#include "keys/FileKey.h"
|
||||
#ifdef WITH_XC_YUBIKEY
|
||||
@@ -368,6 +369,17 @@ namespace Utils
|
||||
return result;
|
||||
}
|
||||
|
||||
QString getTopLevelField(const Entry* entry, const QString& fieldName)
|
||||
{
|
||||
if (fieldName == UuidFieldName) {
|
||||
return entry->uuid().toString();
|
||||
}
|
||||
if (fieldName == TagsFieldName) {
|
||||
return entry->tags();
|
||||
}
|
||||
return QString("");
|
||||
}
|
||||
|
||||
QStringList findAttributes(const EntryAttributes& attributes, const QString& name)
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
Reference in new issue
Block a user