verbose
This commit is contained in:
parent
6c33063be7
commit
e63b4a9e64
|
@ -87,6 +87,8 @@ def print_limited(a, out=None):
|
||||||
|
|
||||||
|
|
||||||
def log(*args, **kwargs):
|
def log(*args, **kwargs):
|
||||||
|
if not verbose:
|
||||||
|
return
|
||||||
s = str(*args).rstrip()
|
s = str(*args).rstrip()
|
||||||
frameinfo = getframeinfo(currentframe().f_back)
|
frameinfo = getframeinfo(currentframe().f_back)
|
||||||
print("%s:%d %s" % (frameinfo.filename, frameinfo.lineno, stack()[1][3]),
|
print("%s:%d %s" % (frameinfo.filename, frameinfo.lineno, stack()[1][3]),
|
||||||
|
@ -95,6 +97,7 @@ def log(*args, **kwargs):
|
||||||
|
|
||||||
|
|
||||||
def popen(p):
|
def popen(p):
|
||||||
|
log(p)
|
||||||
return check_output(p, shell=True).decode('utf-8').splitlines()
|
return check_output(p, shell=True).decode('utf-8').splitlines()
|
||||||
|
|
||||||
|
|
||||||
|
@ -180,6 +183,7 @@ def func_referers_cscope(name):
|
||||||
(name)) if l not in black_list]))
|
(name)) if l not in black_list]))
|
||||||
if not res:
|
if not res:
|
||||||
res = func_referers_git_grep(name)
|
res = func_referers_git_grep(name)
|
||||||
|
log(res)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
@ -1212,7 +1216,8 @@ def main():
|
||||||
while sys.argv[1].startswith('--'):
|
while sys.argv[1].startswith('--'):
|
||||||
global verbose
|
global verbose
|
||||||
log(sys.argv[1][2:])
|
log(sys.argv[1][2:])
|
||||||
verbose = verbose or sys.argv[1][2:] == 'verbose'
|
if sys.argv[1][2:] == 'verbose':
|
||||||
|
verbose = True
|
||||||
sys.argv = sys.argv[1:]
|
sys.argv = sys.argv[1:]
|
||||||
|
|
||||||
a1 = sys.argv[1]
|
a1 = sys.argv[1]
|
||||||
|
|
Loading…
Reference in New Issue