Skip to content

Conversation

@JonathanCrd
Copy link
Member

@JonathanCrd JonathanCrd commented Sep 25, 2025

What does this PR do?

This PR adds the HelpOptions option to all subgroup commands in the Command Factory, ensuring consistent support for --help across the entire hierarchy.

Also, enables support for other ways to ask for help:

  • -h
  • /h
  • -?
  • /?

Additional context

Although help options were expected to work by default, --help was only available at the root level. Using it on a subgroup or command caused an error before displaying help, for example:

Required command was not provided.
Unrecognized command or argument '--help'.

...

With this change, help options now work as expected at all levels without errors:

image

GitHub issue number?

Fixes https://github.com/microsoft/mcp-pr/issues/90

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Updated command list in /docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the --help option functionality for subcommands and command groups by manually adding HelpOption to each command group. Previously, --help only worked at the root level and caused errors when used on subgroups or commands.

Key Changes:

  • Added HelpOption to all subcommand groups to enable consistent help support
  • Imported System.CommandLine.Help namespace to access the HelpOption class
  • Enables support for multiple help formats (--help, -h, /h, -?, /?)

@JonathanCrd JonathanCrd moved this from Untriaged to In Progress in Azure MCP Server Sep 25, 2025
@JonathanCrd JonathanCrd added this to the 2025-09 milestone Sep 25, 2025
@JonathanCrd JonathanCrd enabled auto-merge (squash) September 26, 2025 06:36
@JonathanCrd JonathanCrd merged commit fdda96e into microsoft:main Sep 26, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure MCP Server Sep 26, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Sep 27, 2025
…ross all commands and subgroups (microsoft#583)

* Add HelpOption to each subgroup's command in CommandFactory

* Update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants