This commit is contained in:
Costa Shulyupin 2020-06-24 08:07:44 +03:00
parent 6c33063be7
commit e63b4a9e64
1 changed files with 6 additions and 1 deletions

View File

@ -87,6 +87,8 @@ def print_limited(a, out=None):
def log(*args, **kwargs):
if not verbose:
return
s = str(*args).rstrip()
frameinfo = getframeinfo(currentframe().f_back)
print("%s:%d %s" % (frameinfo.filename, frameinfo.lineno, stack()[1][3]),
@ -95,6 +97,7 @@ def log(*args, **kwargs):
def popen(p):
log(p)
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]))
if not res:
res = func_referers_git_grep(name)
log(res)
return res
@ -1212,7 +1216,8 @@ def main():
while sys.argv[1].startswith('--'):
global verbose
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:]
a1 = sys.argv[1]