From e01e9715b925da073c79a92e9c882416ca84706c Mon Sep 17 00:00:00 2001 From: thez3ro Date: Thu, 16 Feb 2017 20:26:51 +0100 Subject: [PATCH] text for inserting password --- src/cli/Extract.cpp | 5 ++++- src/cli/List.cpp | 4 ++++ src/cli/Merge.cpp | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/cli/Extract.cpp b/src/cli/Extract.cpp index cbdb2a394..5bfb1185f 100644 --- a/src/cli/Extract.cpp +++ b/src/cli/Extract.cpp @@ -33,6 +33,7 @@ int Extract::execute(int argc, char **argv) { QCoreApplication app(argc, argv); + QTextStream out(stdout); QCommandLineParser parser; parser.setApplicationDescription(QCoreApplication::translate("main", @@ -46,6 +47,9 @@ int Extract::execute(int argc, char **argv) return EXIT_FAILURE; } + out << "Insert the database password\n> "; + out.flush(); + static QTextStream inputTextStream(stdin, QIODevice::ReadOnly); QString line = inputTextStream.readLine(); CompositeKey key = CompositeKey::readFromLine(line); @@ -78,7 +82,6 @@ int Extract::execute(int argc, char **argv) return EXIT_FAILURE; } - QTextStream out(stdout); out << xmlData.constData() << "\n"; return EXIT_SUCCESS; diff --git a/src/cli/List.cpp b/src/cli/List.cpp index 0c1389d20..1702a469f 100644 --- a/src/cli/List.cpp +++ b/src/cli/List.cpp @@ -60,6 +60,7 @@ void printGroup(Group* group, QString baseName, int depth) { int List::execute(int argc, char **argv) { QCoreApplication app(argc, argv); + QTextStream out(stdout); QCommandLineParser parser; parser.setApplicationDescription(QCoreApplication::translate("main", @@ -73,6 +74,9 @@ int List::execute(int argc, char **argv) return EXIT_FAILURE; } + out << "Insert the database password\n> "; + out.flush(); + static QTextStream inputTextStream(stdin, QIODevice::ReadOnly); QString line = inputTextStream.readLine(); CompositeKey key = CompositeKey::readFromLine(line); diff --git a/src/cli/Merge.cpp b/src/cli/Merge.cpp index fdc81b9f6..0f4a90117 100644 --- a/src/cli/Merge.cpp +++ b/src/cli/Merge.cpp @@ -35,6 +35,7 @@ int Merge::execute(int argc, char** argv) { QCoreApplication app(argc, argv); + QTextStream out(stdout); QCommandLineParser parser; parser.setApplicationDescription(QCoreApplication::translate("main", "Merge two databases.")); @@ -53,8 +54,10 @@ int Merge::execute(int argc, char** argv) return EXIT_FAILURE; } + out << "Insert the database password\n> "; + out.flush(); + static QTextStream inputTextStream(stdin, QIODevice::ReadOnly); - QString line1 = inputTextStream.readLine(); CompositeKey key1 = CompositeKey::readFromLine(line1); @@ -128,7 +131,7 @@ int Merge::execute(int argc, char** argv) return EXIT_FAILURE; } - qDebug("Successfully merged the database files.\n"); + out << "Successfully merged the database files.\n"; return EXIT_SUCCESS; }