- ccc: print generated command line to stdout instead of stderr
- ccc: quote shell metacharacters in command line to ease copy-and-paste
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49213 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer
index 8427745..fe315f6 100755
--- a/utils/ccc-analyzer
+++ b/utils/ccc-analyzer
@@ -21,9 +21,14 @@
print >> sys.stderr, 'ccc: ' + message
sys.exit(1)
+def quote(arg):
+ if '"' in arg:
+ return repr(arg)
+ return arg
+
def run(args):
- print >> sys.stderr, ' '.join(args)
- print >> sys.stderr, '\n'
+ print ' '.join(map(quote, args))
+ print
code = subprocess.call(args)
if code > 255:
code = 1