aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/main.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2016-09-25 10:04:28 +0200
committerRenaud G <renaud@rolisteam.org>2016-09-25 10:04:28 +0200
commitfac053c3aacc0e2ede8a85ff41e27eed1c360f6f (patch)
treec91ff176e60f1f6e634107b4e7a7282e831975ee /cli/main.cpp
parentdbb57d52d351e340ce69fccaedbdf758b04ed8fe (diff)
parente225f2edfd365d1709df2cb5bb2f752ec8d82c1c (diff)
downloadOneRoll-fac053c3aacc0e2ede8a85ff41e27eed1c360f6f.tar.gz
OneRoll-fac053c3aacc0e2ede8a85ff41e27eed1c360f6f.zip
Merge branch 'master' of github.com:Rolisteam/DiceParser
Diffstat (limited to 'cli/main.cpp')
-rw-r--r--cli/main.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/cli/main.cpp b/cli/main.cpp
index 21bb1ca..7a5ed97 100644
--- a/cli/main.cpp
+++ b/cli/main.cpp
@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2014 by Renaud Guezennec *
-* http://renaudguezennec.homelinux.org/accueil,3.html *
+* http://www.rolisteam.org/contact *
* *
* This file is part of DiceParser *
* *
@@ -77,6 +77,14 @@ QString diceToText(ExportedDiceResult& dice,bool highlight,bool homogeneous)
{
prefix = "\e[34m%1\e[0m";
}
+ if(tmp.getColor()=="red")
+ {
+ prefix = "\e[31m%1\e[0m";
+ }
+ if(tmp.getColor()=="black")
+ {
+ prefix = "\e[30m%1\e[0m";
+ }
}
if(i==0)
@@ -116,8 +124,7 @@ void startDiceParsing(QString& cmd,QString& treeFile,bool highlight)
if(parser->parseLine(cmd))
{
//
- if(treeFile.isEmpty())
- {
+
parser->Start();
if(!parser->getErrorMap().isEmpty())
{
@@ -150,11 +157,10 @@ void startDiceParsing(QString& cmd,QString& treeFile,bool highlight)
str = parser->getStringResult();
}
out << str << "\n";
- }
- else
- {
- parser->writeDownDotTree(treeFile);
- }
+ if(!treeFile.isEmpty())
+ {
+ parser->writeDownDotTree(treeFile);
+ }
}
else
{