From ae5b71fbc1535c6d3112fced769d5237b48dda93 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Fri, 12 Nov 2010 07:10:55 -0800 Subject: [PATCH] Add a -v (verbose) option. --- redo.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/redo.py b/redo.py index 7a5f59f..6c314c6 100755 --- a/redo.py +++ b/redo.py @@ -7,6 +7,7 @@ optspec = """ redo [targets...] -- 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 ifcreate only redo if the file is created """ @@ -110,6 +111,8 @@ def build(t): unlink(tmpname) f = open(tmpname, 'w+') argv = ['sh', '-e', dofile, t, 'FIXME', tmpname] + if REDO_VERBOSE: + argv[1] += 'v' log('%s\n' % t) rv = subprocess.call(argv, stdout=f.fileno()) st = os.stat(tmpname) @@ -139,6 +142,11 @@ if opt.debug: os.putenv('REDO_DEBUG', '1') else: 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: if REDO_TARGET: