diff options
Diffstat (limited to 'src/cli/List.cpp')
-rw-r--r-- | src/cli/List.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cli/List.cpp b/src/cli/List.cpp index d068cdf53..ba00a7162 100644 --- a/src/cli/List.cpp +++ b/src/cli/List.cpp @@ -47,8 +47,8 @@ List::List() int List::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer<QCommandLineParser> parser) { - TextStream outputTextStream(Utils::STDOUT, QIODevice::WriteOnly); - TextStream errorTextStream(Utils::STDERR, QIODevice::WriteOnly); + auto& out = Utils::STDOUT; + auto& err = Utils::STDERR; const QStringList args = parser->positionalArguments(); bool recursive = parser->isSet(List::RecursiveOption); @@ -56,17 +56,17 @@ int List::executeWithDatabase(QSharedPointer<Database> database, QSharedPointer< // No group provided, defaulting to root group. if (args.size() == 1) { - outputTextStream << database->rootGroup()->print(recursive, flatten) << flush; + out << database->rootGroup()->print(recursive, flatten) << flush; return EXIT_SUCCESS; } const QString& groupPath = args.at(1); Group* group = database->rootGroup()->findGroupByPath(groupPath); if (!group) { - errorTextStream << QObject::tr("Cannot find group %1.").arg(groupPath) << endl; + err << QObject::tr("Cannot find group %1.").arg(groupPath) << endl; return EXIT_FAILURE; } - outputTextStream << group->print(recursive, flatten) << flush; + out << group->print(recursive, flatten) << flush; return EXIT_SUCCESS; } |