From 1f3d3ea64e5982a86fffadc1d7131fee84f9cba9 Mon Sep 17 00:00:00 2001 From: jmmv Date: Thu, 26 Jul 2018 14:42:26 -0700 Subject: Send xcode-locator error messages to stderr, not stdout. RELNOTES: None. PiperOrigin-RevId: 206224046 --- tools/osx/xcode_locator.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tools') 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|]" "\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); -- cgit v1.2.3