Skip to content

[MTP CLI Analysis] Help and info categorize core and extension options inconsistently #8427

@Evangelink

Description

@Evangelink

Summary

--help and --info currently disagree about which MTP CLI options are built-in versus extension-provided. The terminal reporter switches are implemented and registered from MTP core, but --help prints them under Extension options. The retry switches come from an extension provider, but --help elevates them into the built-in Options section.

Evidence

  • src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.CommonServices.cs:139

    CommandLine.AddProvider(() => new TerminalTestReporterCommandLineOptionsProvider());

  • src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs:249-255,285-293

    .Where(option => !option.IsHidden && option.IsBuiltIn == builtInOnly)
    �wait PrintOptionsAsync(SystemCommandLineOptionsProviders.Union(nonToolsExtensionProviders), builtInOnly: true)
    �wait PrintOptionsAsync(nonToolsExtensionProviders)

  • src/Platform/Microsoft.Testing.Extensions.Retry/RetryCommandLineOptionsProvider.cs:32-35

ew(..., isBuiltIn: true) for each public retry option.

  • est/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs:65-78 shows a no-extension app printing --no-ansi, --no-progress, --output, --show-stderr, and --show-stdout under Extension options:.
  • est/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs:255-283 lists TerminalTestReporterCommandLineOptionsProvider under Registered command line providers: in --info.
  • est/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs:62-72 shows retry switches in the built-in Options: section.
  • est/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs:420-444 lists RetryCommandLineOptionsProvider under registered providers in --info.

Why this is a real issue

A user reading --help on a stock MTP app sees an Extension options: section even though no optional extensions were added, then sees the same terminal reporter switches identified as a registered core provider in --info. In the opposite direction, retry looks built-in in --help but extension-provided in --info. That makes it harder to reason about what ships in core, what is optional, and which section to look at when debugging option availability.

Suggested resolution

Pick one categorization model and use it consistently in both help and info. Either treat the terminal reporter as built-in everywhere (provider registration plus help sectioning), or rename/reframe the section so core-but-not-system providers are not presented as extensions; likewise, stop elevating retry options into the built-in help section unless the provider is also treated as built-in everywhere else.

Related issues

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions