diff --git a/dotnet-sourcelink/Program.cs b/dotnet-sourcelink/Program.cs index c6511fc..976908d 100644 --- a/dotnet-sourcelink/Program.cs +++ b/dotnet-sourcelink/Program.cs @@ -46,7 +46,7 @@ public static int Main(string[] args) } catch (Exception ex) { - Console.WriteLine(ex.Message); + Console.Error.WriteLine(ex.Message); return -1; } } @@ -67,20 +67,20 @@ public static void PrintJson(CommandLineApplication command) } if (!File.Exists(path)) { - Console.WriteLine("file does not exist: " + path); + Console.Error.WriteLine("file does not exist: " + path); return 3; } using (var drp = DebugReaderProvider.Create(path)) { if(drp == null) { - Console.WriteLine("unable to read debug info: " + path); + Console.Error.WriteLine("unable to read debug info: " + path); return 5; } var bytes = GetSourceLinkBytes(drp); if (bytes == null || bytes.Length == 0) { - Console.WriteLine("Source Link JSON not found in file: " + path); + Console.Error.WriteLine("Source Link JSON not found in file: " + path); return 4; } Console.WriteLine(Encoding.UTF8.GetString(bytes)); @@ -106,7 +106,7 @@ public static void PrintDocuments(CommandLineApplication command) } if (!File.Exists(path)) { - Console.WriteLine("file does not exist: " + path); + Console.Error.WriteLine("file does not exist: " + path); return 3; } @@ -114,7 +114,7 @@ public static void PrintDocuments(CommandLineApplication command) { if (drp == null) { - Console.WriteLine("unable to read debug info: " + path); + Console.Error.WriteLine("unable to read debug info: " + path); return 4; } foreach (var doc in GetDocuments(drp)) @@ -143,7 +143,7 @@ public static void PrintUrls(CommandLineApplication command) } if (!File.Exists(path)) { - Console.WriteLine("file does not exist: " + path); + Console.Error.WriteLine("file does not exist: " + path); return 3; } @@ -151,7 +151,7 @@ public static void PrintUrls(CommandLineApplication command) { if (drp == null) { - Console.WriteLine("unable to read debug info: " + path); + Console.Error.WriteLine("unable to read debug info: " + path); return 5; } var missingDocs = new List(); @@ -174,10 +174,10 @@ public static void PrintUrls(CommandLineApplication command) } if (missingDocs.Count > 0) { - Console.WriteLine("" + missingDocs.Count + " Documents without URLs:"); + Console.Error.WriteLine("" + missingDocs.Count + " Documents without URLs:"); foreach (var doc in missingDocs) { - Console.WriteLine("{0} {1} {2} {3}", doc.Hash.ToHex(), HashAlgorithmGuids.GetName(doc.HashAlgorithm), LanguageGuids.GetName(doc.Language), doc.Name); + Console.Error.WriteLine("{0} {1} {2} {3}", doc.Hash.ToHex(), HashAlgorithmGuids.GetName(doc.HashAlgorithm), LanguageGuids.GetName(doc.Language), doc.Name); } return 4; } @@ -193,7 +193,7 @@ public static int TestFile(string path, IAuthenticationHeaderValueProvider authe { if (drp == null) { - Console.WriteLine("unable to read debug info: " + path); + Console.Error.WriteLine("unable to read debug info: " + path); return 5; } return TestFile(drp, authenticationHeaderValueProvider); @@ -308,7 +308,7 @@ public static int TestNupkg(string path, List files, IAuthenticationHead { if (drp == null) { - Console.WriteLine("unable to read debug info: " + path); + Console.Error.WriteLine("unable to read debug info: " + path); return 5; } if (TestFile(drp, authenticationHeaderValueProvider) != 0) @@ -357,7 +357,7 @@ public static void Test(CommandLineApplication command) } if (!File.Exists(path)) { - Console.WriteLine("file does not exist: " + path); + Console.Error.WriteLine("file does not exist: " + path); return 3; }