mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
github actions seem to fail because of iostream. Do not analyze the details for hours, but drop the last iostream references and hope it helps. iostream was not the culprit. Keep this change anyway, since it makes sense and unifies stdout access.
30 lines
578 B
C++
30 lines
578 B
C++
#include <QTextStream>
|
|
#include <QDebug>
|
|
#include <QByteArray>
|
|
#include <QFile>
|
|
|
|
#include "arguments.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
if (argc < 2) {
|
|
qWarning() << "Need type argument: <man|rst|completion>";
|
|
return EXIT_FAILURE;
|
|
}
|
|
QByteArray doc = arguments::doc(argv[1]).toUtf8();
|
|
if (doc.isEmpty()) {
|
|
qWarning() << QString("Doc was empty: %1").arg(argv[1]);
|
|
return EXIT_FAILURE;
|
|
}
|
|
if (argc > 2) {
|
|
QFile f(argv[2]);
|
|
f.open(QIODevice::WriteOnly);
|
|
f.write(doc);
|
|
f.close();
|
|
} else {
|
|
QTextStream out(stdout);
|
|
out << doc;
|
|
}
|
|
return EXIT_SUCCESS;
|
|
}
|