summaryrefslogtreecommitdiff
path: root/tools/showvars.py
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2011-02-07 19:36:23 +0100
committerStefan Beller <stefanbeller@googlemail.com>2011-02-07 19:36:56 +0100
commit0099e62514d50aee63b912ad17c4fba819d04541 (patch)
treeed12003a5dac2d130ea0d13037b6ee9b65aa0160 /tools/showvars.py
parent67c8c9069f523655f9042d06e69d841ac723c63e (diff)
downloadserverdata-0099e62514d50aee63b912ad17c4fba819d04541.tar.gz
serverdata-0099e62514d50aee63b912ad17c4fba819d04541.tar.bz2
serverdata-0099e62514d50aee63b912ad17c4fba819d04541.tar.xz
serverdata-0099e62514d50aee63b912ad17c4fba819d04541.zip
improve showvars.py
added an option to show local variables as well
Diffstat (limited to 'tools/showvars.py')
-rwxr-xr-xtools/showvars.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/showvars.py b/tools/showvars.py
index 7e9c0625..376f804e 100755
--- a/tools/showvars.py
+++ b/tools/showvars.py
@@ -13,6 +13,9 @@ parser.add_option("-v", "--verbose", dest="verbose", action="store_true", defaul
parser.add_option("-f", "--file", dest="fname", default="",
help="inspect that file", metavar="FILE")
+parser.add_option("-l", "--localvariables", dest="localvars", action="store_true", default=False,
+ help="show local variables as well")
+
(options, args) = parser.parse_args()
def handleFile(fname):
@@ -45,7 +48,7 @@ def handleFile(fname):
varname = line[0:endpos].strip()
assignment = line[endpos+1:].strip()[:-1] # remove semicolon
if assignment != "0":
- if varname.startswith("@"):
+ if varname.startswith("@") and not options.localvars:
continue
if varname.startswith("$"):
continue