Add a little optional verbosity.
authorCarl Hetherington <cth@carlh.net>
Thu, 5 Mar 2020 11:45:32 +0000 (12:45 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 5 Mar 2020 11:45:32 +0000 (12:45 +0100)
cdist

diff --git a/cdist b/cdist
index 71ab475e301b50b2f20f0ae56cd61a4a51430258..0a13bff3de9983a8ea12fc027b34e43381e1027f 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -970,12 +970,19 @@ class Tree(object):
 
     def build_dependencies(self, options):
         for i in self.dependencies(options):
+            global args
+            if args.verbose:
+                print('Building a dependency of %s %s %s with %s' % (self.name, self.specifier, self.version, options))
             i[0].build(i[1])
 
     def build(self, options):
         if self.built:
             return
 
+        global args
+        if args.verbose:
+            print("* Building %s %s %s with %s" % (self.name, self.specifier, self.version, options))
+
         variables = copy.copy(self.target.variables)
 
         # Start with the options passed in
@@ -1042,6 +1049,8 @@ def main():
     parser.add_argument('--no-version-commit', help="use just tags for versioning, don't modify wscript, ChangeLog etc.", action='store_true')
     parser.add_argument('--option', help='set an option for the build (use --option key:value)', action='append')
     parser.add_argument('--ccache', help='use ccache', action='store_true')
+    parser.add_argument('--verbose', help='be verbose', action='store_true')
+    global args
     args = parser.parse_args()
 
     # Check for incorrect multiple parameters