From: Seo Sanghyeon Date: Fri, 4 Apr 2008 11:02:21 +0000 (+0000) Subject: - ccc: print generated command line to stdout instead of stderr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d389465f426069115a35e857ef11f1fcc5a2f69c;p=clang - 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 b/utils/ccc index 5b54c476c2..43093cb441 100755 --- a/utils/ccc +++ b/utils/ccc @@ -18,8 +18,13 @@ def error(message): 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 ' '.join(map(quote, args)) code = subprocess.call(args) if code > 255: code = 1 diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer index 8427745127..fe315f6df0 100755 --- a/utils/ccc-analyzer +++ b/utils/ccc-analyzer @@ -21,9 +21,14 @@ def error(message): 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