Skip to content

Commit 0321073

Browse files
[VMR] Codeflow d7d8500-d7d8500
[[ commit created by automation ]]
1 parent 3bcbb87 commit 0321073

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,8 @@ public CommandGroup(string commandPrompt = null)
300300
/// <exception cref="DiagnosticsException">parsing error</exception>
301301
internal bool Execute(IReadOnlyList<string> commandLine, IServiceProvider services)
302302
{
303-
IConsoleService consoleService = services.GetService<IConsoleService>();
304-
CommandLineConfiguration configuration = new(_rootCommand)
305-
{
306-
Output = new ConsoleServiceWrapper(consoleService.Write),
307-
Error = new ConsoleServiceWrapper(consoleService.WriteError)
308-
};
309-
310303
// Parse the command line and invoke the command
311-
ParseResult parseResult = configuration.Parse(commandLine);
304+
ParseResult parseResult = _rootCommand.Parse(commandLine);
312305

313306
if (parseResult.Errors.Count > 0)
314307
{

src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static void ConsoleWriteLine(string str)
5454
/// <param name="stoppingEventPayloadFilter">A string, parsed as [payload_field_name]:[payload_field_value] pairs separated by commas, that will stop the trace upon hitting an event with a matching payload. Requires `--stopping-event-provider-name` and `--stopping-event-event-name` to be set.</param>
5555
/// <param name="rundown">Collect rundown events.</param>
5656
/// <returns></returns>
57-
private static async Task<int> Collect(CancellationToken ct, CommandLineConfiguration cliConfig, int processId, FileInfo output, uint buffersize, string providers, string profile, TraceFileFormat format, TimeSpan duration, string clrevents, string clreventlevel, string name, string diagnosticPort, bool showchildio, bool resumeRuntime, string stoppingEventProviderName, string stoppingEventEventName, string stoppingEventPayloadFilter, bool? rundown, string dsrouter)
57+
private static async Task<int> Collect(CancellationToken ct, InvocationConfiguration cliConfig, int processId, FileInfo output, uint buffersize, string providers, string profile, TraceFileFormat format, TimeSpan duration, string clrevents, string clreventlevel, string name, string diagnosticPort, bool showchildio, bool resumeRuntime, string stoppingEventProviderName, string stoppingEventEventName, string stoppingEventPayloadFilter, bool? rundown, string dsrouter)
5858
{
5959
bool collectionStopped = false;
6060
bool cancelOnEnter = true;
@@ -587,7 +587,7 @@ public static Command CollectCommand()
587587

588588
collectCommand.SetAction((parseResult, ct) => Collect(
589589
ct,
590-
cliConfig: parseResult.Configuration,
590+
cliConfig: parseResult.InvocationConfiguration,
591591
processId: parseResult.GetValue(CommonOptions.ProcessIdOption),
592592
output: parseResult.GetValue(OutputPathOption),
593593
buffersize: parseResult.GetValue(CircularBufferOption),

0 commit comments

Comments
 (0)