Skip to content

Fix command order in root help usage - #11108

Open
vicancy wants to merge 1 commit into
mainfrom
vicancy-issue-11034-docfx-help-lists-arguments-in-wrong-orde-bdac1b
Open

Fix command order in root help usage#11108
vicancy wants to merge 1 commit into
mainfrom
vicancy-issue-11034-docfx-help-lists-arguments-in-wrong-orde-bdac1b

Conversation

@vicancy

@vicancy vicancy commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #11034

Uses Spectre.Console.Cli's custom HelpProvider extension point to render the optional command before the default command's arguments and options. All non-root usage output continues through Spectre's default provider.

Adds a focused test for docfx -? that asserts docfx [COMMAND] [config] [OPTIONS] and guards against the previous order.

Validation:

  • dotnet format test\docfx.Tests\docfx.Tests.csproj --no-restore --verify-no-changes --include src\docfx\Program.cs src\docfx\Extensions\DocfxHelpProvider.cs test\docfx.Tests\CommandLineTest.cs
  • dotnet build test\docfx.Tests\docfx.Tests.csproj --configuration Release --framework net8.0 --no-restore --warnAsError
  • dotnet test test\docfx.Tests\docfx.Tests.csproj --configuration Release --framework net8.0 --no-build --no-restore --filter "FullyQualifiedName~Docfx.Tests.CommandLineTest"

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] docfx -? lists arguments in wrong order: [config] [OPTIONS] [COMMAND]

1 participant