Skip to content

Commit f3c2acd

Browse files
committed
fix some of the failing tests
1 parent 53c7036 commit f3c2acd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,12 @@ internal string GetDetailedHelp(Command command, IServiceProvider services)
436436
Output = console
437437
};
438438

439-
// Get the command help by parsing the --help option
440-
// and invoking the help action that writes to configuration.Output.
439+
// Get the command help by parsing the --help option.
440+
// The option is hidden so it doesn't show up in the help text.
441+
command.Options.Add(new HelpOption() { Hidden = true });
442+
// Invoking the help action writes to configuration.Output.
441443
command.Parse(["--help"], configuration).Invoke();
444+
command.Options.RemoveAt(command.Options.Count - 1); // Remove the help option
442445

443446
// Get the detailed help if any
444447
if (TryGetCommandHandler(command.Name, out CommandHandler handler))

0 commit comments

Comments
 (0)