From bf774bcce4d4e3ba98e8681b875fc49975fe40f5 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 11 Dec 2021 18:27:54 +0100 Subject: Fix debug output. --- cli/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/main.cpp b/cli/main.cpp index 918636e..3298eac 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -294,7 +294,7 @@ void displayCommandResult(QString json, bool withColor) out << str << "\n"; } -int startDiceParsing(QStringList& cmds, bool withColor, EXPORTFORMAT format, QJsonArray array) +int startDiceParsing(QStringList& cmds, bool withColor, EXPORTFORMAT format, QJsonArray array, const QString& filePath) { DiceParser parser; parser.insertAlias(new DiceAlias("L5R5R", QStringLiteral("L[-,⨀,⨀⬢,❂⬢,❁,❁⬢]")), 0); @@ -439,6 +439,10 @@ int startDiceParsing(QStringList& cmds, bool withColor, EXPORTFORMAT format, QJs break; #endif } + if(!filePath.isEmpty()) + { + parser.writeDownDotTree(filePath); + } } else rt= 1; @@ -595,7 +599,7 @@ int main(int argc, char* argv[]) aliases= doc.array(); } - returnValue= startDiceParsing(cmdList, colorb, format, aliases); + returnValue= startDiceParsing(cmdList, colorb, format, aliases, dotFileStr); if(optionParser.isSet(help)) { out << optionParser.helpText(); -- cgit v1.2.3-70-g09d2