OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """ | 5 """ |
6 This module helps emulate Visual Studio 2008 behavior on top of other | 6 This module helps emulate Visual Studio 2008 behavior on top of other |
7 build systems, primarily ninja. | 7 build systems, primarily ninja. |
8 """ | 8 """ |
9 | 9 |
10 import re | 10 import re |
(...skipping 22 matching lines...) Expand all Loading... |
33 # %'s also need to be doubled otherwise they're interpreted as batch | 33 # %'s also need to be doubled otherwise they're interpreted as batch |
34 # positional arguments. Also make sure to escape the % so that they're | 34 # positional arguments. Also make sure to escape the % so that they're |
35 # passed literally through escaping so they can be singled to just the | 35 # passed literally through escaping so they can be singled to just the |
36 # original %. Otherwise, trying to pass the literal representation that | 36 # original %. Otherwise, trying to pass the literal representation that |
37 # looks like an environment variable to the shell (e.g. %PATH%) would fail. | 37 # looks like an environment variable to the shell (e.g. %PATH%) would fail. |
38 tmp = tmp.replace('%', '^%^%') | 38 tmp = tmp.replace('%', '^%^%') |
39 | 39 |
40 # Finally, wrap the whole thing in quotes so that the above quote rule | 40 # Finally, wrap the whole thing in quotes so that the above quote rule |
41 # applies and whitespace isn't a word break. | 41 # applies and whitespace isn't a word break. |
42 return '"' + tmp + '"' | 42 return '"' + tmp + '"' |
| 43 |
| 44 def EncodeCmdExeList(args): |
| 45 """Process a list of arguments using QuoteCmdExeArgument.""" |
| 46 return ' '.join(QuoteCmdExeArgument(arg) for arg in args) |
OLD | NEW |