Add concrete examples to all --help screens#1549
Conversation
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR adds concrete usage examples to help screens across Dev Proxy commands to improve discoverability for AI agents and human users. The implementation introduces a new HelpExamples helper class that extends System.CommandLine's help system by appending examples after the default help output.
Changes:
- Created
HelpExamples.csinfrastructure using ConditionalWeakTable and custom HelpOption.Action - Added 3-5 examples to each command's help screen (root, cert, config, jwt create, stdio, outdated, msgraphdb)
- Examples show concrete command invocations with aligned descriptions at column 52
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| DevProxy/Commands/HelpExamples.cs | New helper class implementing custom help action to append examples after default help output using ConditionalWeakTable pattern |
| DevProxy/Commands/DevProxyCommand.cs | Added root command examples and installed HelpExamples infrastructure on RootCommand |
| DevProxy/Commands/CertCommand.cs | Added examples for cert ensure and cert remove subcommands |
| DevProxy/Commands/ConfigCommand.cs | Added examples for config new, get, and open subcommands |
| DevProxy/Commands/JwtCommand.cs | Added examples for jwt create with various option combinations |
| DevProxy/Commands/StdioCommand.cs | Added examples for stdio command with different executable types |
| DevProxy/Commands/OutdatedCommand.cs | Added examples for outdated command with and without --short option |
| DevProxy/Commands/MsGraphDbCommand.cs | Added example for msgraphdb command |
garrytrinder
left a comment
There was a problem hiding this comment.
Tested: builds clean, examples present in all commands (root, cert, config, jwt create, stdio, outdated, msgraphdb). Merge conflict with main resolved (ExitCodeHelpAction + HelpExamples coexist). LGTM.
DevProxy/Commands/HelpExamples.cs- helper class with custom help action that appends examples after default help outputDevProxyCommand.cs(root command) and install the custom help actionCertCommand.csConfigCommand.csJwtCommand.cs(jwt create subcommand)StdioCommand.csOutdatedCommand.csMsGraphDbCommand.csOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.