BV strategy for SMT-EVAL
[cvc5.git] / contrib / debug-keys
1 #!/bin/bash
2 #
3 # Lists the Trace() and Debug() keys used in sources.
4 #
5 # e.g. if Debug("uf") occurs in the sources, then "uf" is printed by this script.
6
7 if [ "$1" = "-h" -o "$1" = "-help" -o "$1" = "-?" -o "$1" = "--help" ]; then
8 echo "usage: `basename $0` [dirs...]" >&2
9 echo "This utility will print all Debug("foo") and Trace("foo") keys."
10 echo "With optional dirs..., use dirs instead of top-level \"src\"." >&2
11 exit 1
12 fi
13
14 if [ $# -eq 0 ]; then
15 cd `dirname "$0"`/..
16
17 if ! [ -d src ]; then
18 echo "`basename $0`: not in CVC4 directory tree?!" >&2
19 exit 1
20 fi
21
22 set src
23 fi
24
25 echo "Trace and debug flags used in $*:"
26
27 while [ $# -gt 0 ]; do
28 dir="$1"
29 shift
30
31 test -r "$dir" && grep -r --exclude-dir=.svn '\(Debug\|Trace\)\(\.isOn\)\?("[^"]\+")' "$dir" | sed 's,.*\(Debug\|Trace\)\(\.isOn\)\?("\([^"]\+\)").*,\3,' | sort -u
32 done | sort -u
33