aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar jmmv <jmmv@google.com>2018-07-26 14:42:26 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-26 14:43:54 -0700
commit1f3d3ea64e5982a86fffadc1d7131fee84f9cba9 (patch)
treec93b4ac92e48e4269e22164a7f78bd9ae7d8757f /tools
parent7e87730de985b7099b9b683571d58efdaab70890 (diff)
Send xcode-locator error messages to stderr, not stdout.
RELNOTES: None. PiperOrigin-RevId: 206224046
Diffstat (limited to 'tools')
-rw-r--r--tools/osx/xcode_locator.m13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/osx/xcode_locator.m b/tools/osx/xcode_locator.m
index f36ead493d..65401006bf 100644
--- a/tools/osx/xcode_locator.m
+++ b/tools/osx/xcode_locator.m
@@ -129,7 +129,8 @@ int main(int argc, const char * argv[]) {
}
}
if (versionArg == nil) {
- printf(
+ fprintf(
+ stderr,
"xcode-locator [-v|<version_number>]"
"\n\n"
"Given a version number, or partial version number in x.y.z format, "
@@ -155,20 +156,20 @@ int main(int argc, const char * argv[]) {
CFSTR("com.apple.dt.Xcode"), &cfError));
if (array == nil) {
NSError *nsError = (__bridge NSError *)cfError;
- printf("error: %s\n", nsError.description.UTF8String);
+ fprintf(stderr, "error: %s\n", nsError.description.UTF8String);
return 1;
}
for (NSURL *url in array) {
NSBundle *bundle = [NSBundle bundleWithURL:url];
if (!bundle) {
- printf("error: Unable to open bundle at URL: %s\n",
- url.description.UTF8String);
+ fprintf(stderr, "error: Unable to open bundle at URL: %s\n",
+ url.description.UTF8String);
return 1;
}
NSString *version = bundle.infoDictionary[@"CFBundleShortVersionString"];
if (!version) {
- printf("error: Unable to extract CFBundleShortVersionString from URL: "
- "%s\n", url.description.UTF8String);
+ fprintf(stderr, "error: Unable to extract CFBundleShortVersionString "
+ "from URL: %s\n", url.description.UTF8String);
return 1;
}
version = ExpandVersion(version);