From: Sung Yoon Whang Date: Wed, 25 Sep 2019 21:40:45 +0000 (-0700) Subject: Fix the error message when not a valid process ID is specified (#501) X-Git-Tag: submit/tizen/20200402.013218~14^2^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f92d9203692e86b7e67ec813cefa66c4555a2516;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix the error message when not a valid process ID is specified (#501) --- diff --git a/src/Tools/dotnet-counters/CounterMonitor.cs b/src/Tools/dotnet-counters/CounterMonitor.cs index d7cf5ebba..05b27465a 100644 --- a/src/Tools/dotnet-counters/CounterMonitor.cs +++ b/src/Tools/dotnet-counters/CounterMonitor.cs @@ -145,7 +145,7 @@ namespace Microsoft.Diagnostics.Tools.Counters private async Task StartMonitor() { if (_processId == 0) { - _console.Error.WriteLine("ProcessId is required."); + _console.Error.WriteLine("--process-id is required."); return 1; } diff --git a/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs b/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs index ca46abe1e..dc93f1a9e 100644 --- a/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs +++ b/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs @@ -39,11 +39,16 @@ namespace Microsoft.Diagnostics.Tools.Trace Debug.Assert(output != null); Debug.Assert(profile != null); Console.Clear(); - if (processId <= 0) + if (processId < 0) { Console.Error.WriteLine("Process ID should not be negative."); return ErrorCodes.ArgumentError; } + else if (processId == 0) + { + Console.Error.WriteLine("--process-id is required"); + return ErrorCodes.ArgumentError; + } if (profile.Length == 0 && providers.Length == 0) {