docs icon indicating copy to clipboard operation
docs copied to clipboard

docs: fix System.CommandLine tab-completion example to use RootCommand

Open abhiramch018 opened this issue 2 weeks ago • 0 comments

Summary

Fixed the tab-completion example in how-to-enable-tab-completion.md by updating the sample code to use RootCommand instead of Command.

Changes

  • Wrapped the command in a RootCommand.
  • Updated the invocation to use rootCommand.Parse(args).InvokeAsync().
  • Verified that tab-completion and help now work correctly.

Why

Fixes #48478 — the original code used .Parse(args).Invoke() on a Command, which prevented tab-completion and help from working as intended.

Summary

Describe your changes here.

Fixes #Issue_Number (if available)

abhiramch018 avatar Nov 25 '25 12:11 abhiramch018