Add --username option to Clip command. (#3947)

* make Clip accept an attribute name

This allows users to copy arbitrary attributes (e.g. username, notes,
URL) to the clipboard in addition to the password and TOTP values.

* update Clip manpage

* Add findAttributes to CLI utils

* Use case-insensitive search in Show command.

* Use case-insensitive search in Clip command.

Co-authored-by: louib <[email protected]>
This commit is contained in:
James Ringandlouib authored and GitHub committed 2020-01-30 15:46:48 -05:00
1 parent 06e0f38523
commit 71a39c37ec
8 files changed
+135 -26

No files matched your search

+17
View File
@@ -331,4 +331,21 @@ namespace Utils
return result;
}
QStringList findAttributes(const EntryAttributes& attributes, const QString& name)
{
QStringList result;
if (attributes.hasKey(name)) {
result.append(name);
return result;
}
for (const QString& key : attributes.keys()) {
if (key.compare(name, Qt::CaseSensitivity::CaseInsensitive) == 0) {
result.append(key);
}
}
return result;
}
} // namespace Utils