summaryrefslogtreecommitdiff
path: root/tools/validateinterfaces.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-10 22:59:45 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-10 22:59:45 +0300
commite56747c574e3956504f0c62dd89a27e74bddb83d (patch)
tree909ba79fdc6a79f1308d49fa45667b63982893fc /tools/validateinterfaces.py
parentbe19d06b83e10c23b562c7bebe455e026a5fd738 (diff)
downloadhercules-e56747c574e3956504f0c62dd89a27e74bddb83d.tar.gz
hercules-e56747c574e3956504f0c62dd89a27e74bddb83d.tar.bz2
hercules-e56747c574e3956504f0c62dd89a27e74bddb83d.tar.xz
hercules-e56747c574e3956504f0c62dd89a27e74bddb83d.zip
Add command line option for silent checks.
It will show anything only if error found. Command line option: silent
Diffstat (limited to 'tools/validateinterfaces.py')
-rwxr-xr-xtools/validateinterfaces.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/tools/validateinterfaces.py b/tools/validateinterfaces.py
index 985ab4d59..6061b358b 100755
--- a/tools/validateinterfaces.py
+++ b/tools/validateinterfaces.py
@@ -5,9 +5,11 @@
import os
import re
+import sys
from sets import Set
interfaceRe = re.compile("struct (?P<name1>[a-z_]+)_interface (?P<name2>[a-z_]+)_s;")
+silent = False
class Tracker:
pass
@@ -155,14 +157,21 @@ def reportMethods(tracker):
tracker = Tracker()
tracker.arr = dict()
tracker.methods = Set()
-print "Checking initerfaces initialisation"
-processIfDir(tracker, "../src/char");
-processIfDir(tracker, "../src/map");
-processIfDir(tracker, "../src/login");
-processIfDir(tracker, "../src/common");
-print "Checking interfaces usage"
-processDir(tracker, "../src/char");
-processDir(tracker, "../src/map");
-processDir(tracker, "../src/login");
-processDir(tracker, "../src/common");
-reportMethods(tracker)
+if len(sys.argv) > 1 and sys.argv[1] == "silent":
+ silent = True
+ processIfDir(tracker, "../src/char");
+ processIfDir(tracker, "../src/map");
+ processIfDir(tracker, "../src/login");
+ processIfDir(tracker, "../src/common");
+else:
+ print "Checking initerfaces initialisation"
+ processIfDir(tracker, "../src/char");
+ processIfDir(tracker, "../src/map");
+ processIfDir(tracker, "../src/login");
+ processIfDir(tracker, "../src/common");
+ print "Checking interfaces usage"
+ processDir(tracker, "../src/char");
+ processDir(tracker, "../src/map");
+ processDir(tracker, "../src/login");
+ processDir(tracker, "../src/common");
+ reportMethods(tracker)