diff options
author | andreas-ementio <109289207+andreas-ementio@users.noreply.github.com> | 2022-07-14 18:19:31 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2022-09-08 13:48:18 +0300 |
commit | 612c1098eaa9cfa54fe4dbe9c6e11d3e2e18fdae (patch) | |
tree | ca2e25b3874e4421476f340b459eea763c08bb08 | |
parent | ed7b634dbf157915d55af5b13d6780bd41d83e36 (diff) |
Fix CLI output when using clip with the -t flag
if you use the CLI with -t/--totp flag, the program prints out: "Entry's "password" attribute copied to the clipboard!"
expected output is "Entry's "totp" attribute copied to the clipboard!" the same when you run with -a totp
-rw-r--r-- | src/cli/Clip.cpp | 1 | ||||
-rw-r--r-- | tests/TestCli.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/cli/Clip.cpp b/src/cli/Clip.cpp index 64e56638e..47964b190 100644 --- a/src/cli/Clip.cpp +++ b/src/cli/Clip.cpp @@ -116,6 +116,7 @@ int Clip::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer< return EXIT_FAILURE; } + selectedAttribute = "totp"; found = true; value = entry->totp(); } else if (Utils::EntryFieldNames.contains(selectedAttribute)) { diff --git a/tests/TestCli.cpp b/tests/TestCli.cpp index 14012cdcd..f822dfe34 100644 --- a/tests/TestCli.cpp +++ b/tests/TestCli.cpp @@ -671,6 +671,7 @@ void TestCli::testClip() setInput("a"); execCmd(clipCmd, {"clip", m_dbFile->fileName(), "/Sample Entry", "0", "--totp"}); QTRY_VERIFY(isTotp(clipboard->text())); + QCOMPARE(m_stdout->readLine(), QByteArray("Entry's \"totp\" attribute copied to the clipboard!\n")); // Test Unicode setInput("a"); |