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:
louib authored and Jonathan White committed 2022-09-22 06:49:07 -04:00
1 parent e245701533
commit e7e75c1277
6 files changed
+57 -4

No files matched your search

+12
View File
@@ -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;