Add a -v (verbose) option.
This commit is contained in:
parent
9a45f066f8
commit
ae5b71fbc1
1 changed files with 8 additions and 0 deletions
8
redo.py
8
redo.py
|
|
@ -7,6 +7,7 @@ optspec = """
|
||||||
redo [targets...]
|
redo [targets...]
|
||||||
--
|
--
|
||||||
d,debug print dependency checks as they happen
|
d,debug print dependency checks as they happen
|
||||||
|
v,verbose print commands as they are run
|
||||||
ifchange only redo if the file is modified or deleted
|
ifchange only redo if the file is modified or deleted
|
||||||
ifcreate only redo if the file is created
|
ifcreate only redo if the file is created
|
||||||
"""
|
"""
|
||||||
|
|
@ -110,6 +111,8 @@ def build(t):
|
||||||
unlink(tmpname)
|
unlink(tmpname)
|
||||||
f = open(tmpname, 'w+')
|
f = open(tmpname, 'w+')
|
||||||
argv = ['sh', '-e', dofile, t, 'FIXME', tmpname]
|
argv = ['sh', '-e', dofile, t, 'FIXME', tmpname]
|
||||||
|
if REDO_VERBOSE:
|
||||||
|
argv[1] += 'v'
|
||||||
log('%s\n' % t)
|
log('%s\n' % t)
|
||||||
rv = subprocess.call(argv, stdout=f.fileno())
|
rv = subprocess.call(argv, stdout=f.fileno())
|
||||||
st = os.stat(tmpname)
|
st = os.stat(tmpname)
|
||||||
|
|
@ -139,6 +142,11 @@ if opt.debug:
|
||||||
os.putenv('REDO_DEBUG', '1')
|
os.putenv('REDO_DEBUG', '1')
|
||||||
else:
|
else:
|
||||||
REDO_DEBUG = os.getenv('REDO_DEBUG', '') and 1 or 0
|
REDO_DEBUG = os.getenv('REDO_DEBUG', '') and 1 or 0
|
||||||
|
if opt.verbose:
|
||||||
|
REDO_VERBOSE = 1
|
||||||
|
os.putenv('REDO_VERBOSE', '1')
|
||||||
|
else:
|
||||||
|
REDO_VERBOSE = os.getenv('REDO_VERBOSE', '') and 1 or 0
|
||||||
|
|
||||||
for t in targets:
|
for t in targets:
|
||||||
if REDO_TARGET:
|
if REDO_TARGET:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue