summaryrefslogtreecommitdiff
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
commitaca3bbdb0bc35b79d8604b6db6a5d9d5b05c5fdc (patch)
treebfa6ad364daca5da13e794633a2822c57b7ece3c
parentd3867809162ae03c93a71c6606ff87baba2074dc (diff)
downloadtools-aca3bbdb0bc35b79d8604b6db6a5d9d5b05c5fdc.tar.gz
tools-aca3bbdb0bc35b79d8604b6db6a5d9d5b05c5fdc.tar.bz2
tools-aca3bbdb0bc35b79d8604b6db6a5d9d5b05c5fdc.tar.xz
tools-aca3bbdb0bc35b79d8604b6db6a5d9d5b05c5fdc.zip
improve showvars.py
added an option to show local variables as well
-rwxr-xr-xshowvars.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/showvars.py b/showvars.py
index 7e9c062..376f804 100755
--- a/showvars.py
+++ b/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