mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 15:29:44 -05:00
Small cleanup in cli/Show.cpp
This commit is contained in:
parent
b78ca924fd
commit
c97ee5395b
@ -78,7 +78,7 @@ int Show::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If no attributes specified, output the default attribute set.
|
// If no attributes specified, output the default attribute set.
|
||||||
bool showAttributeNames = attributes.isEmpty() && !showTotp;
|
bool showDefaultAttributes = attributes.isEmpty() && !showTotp;
|
||||||
if (attributes.isEmpty() && !showTotp) {
|
if (attributes.isEmpty() && !showTotp) {
|
||||||
attributes = EntryAttributes::DefaultAttributes;
|
attributes = EntryAttributes::DefaultAttributes;
|
||||||
}
|
}
|
||||||
@ -91,10 +91,10 @@ int Show::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<
|
|||||||
errorTextStream << QObject::tr("ERROR: unknown attribute %1.").arg(attributeName) << endl;
|
errorTextStream << QObject::tr("ERROR: unknown attribute %1.").arg(attributeName) << endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (showAttributeNames) {
|
if (showDefaultAttributes) {
|
||||||
outputTextStream << attributeName << ": ";
|
outputTextStream << attributeName << ": ";
|
||||||
}
|
}
|
||||||
if (entry->attributes()->isProtected(attributeName) && showAttributeNames && !showProtectedAttributes) {
|
if (entry->attributes()->isProtected(attributeName) && showDefaultAttributes && !showProtectedAttributes) {
|
||||||
outputTextStream << "PROTECTED" << endl;
|
outputTextStream << "PROTECTED" << endl;
|
||||||
} else {
|
} else {
|
||||||
outputTextStream << entry->resolveMultiplePlaceholders(entry->attributes()->value(attributeName)) << endl;
|
outputTextStream << entry->resolveMultiplePlaceholders(entry->attributes()->value(attributeName)) << endl;
|
||||||
@ -102,9 +102,6 @@ int Show::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (showTotp) {
|
if (showTotp) {
|
||||||
if (showAttributeNames) {
|
|
||||||
outputTextStream << "TOTP: ";
|
|
||||||
}
|
|
||||||
outputTextStream << entry->totp() << endl;
|
outputTextStream << entry->totp() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user