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-22 13:49:07 +0300 |
commit | 8654b25e802c0fa0cd4b8dbc1957100be93b7e6a (patch) | |
tree | 9db2f9b48d9b4dc502735e530909a28b61066871 | |
parent | f95019964e45b8d8323a7d74cfad7e29e7fd1139 (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"); |