From d389465f426069115a35e857ef11f1fcc5a2f69c Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 4 Apr 2008 11:02:21 +0000 Subject: [PATCH] - 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 --- utils/ccc | 7 ++++++- utils/ccc-analyzer | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) 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 -- 2.40.0