enhancement: streamline command handling and enhance help output#748
Closed
NamrathShetty wants to merge 1 commit intomodelcontextprotocol:mainfrom
Closed
enhancement: streamline command handling and enhance help output#748NamrathShetty wants to merge 1 commit intomodelcontextprotocol:mainfrom
NamrathShetty wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
- Refactored main() to handle global help/version flags before command dispatch - Added command-specific help with --help, -h, or help subcommand support - Enhanced printCommandHelp() with detailed descriptions, examples, and available options - Added comprehensive documentation for init, login, logout, and publish commands - Used fmt.Fprintln with explicit os.Stdout for consistent output handling - Improved code organization by extracting cmd and args variables early - Fixed gofmt compliance by adding missing newline at end of file Signed-off-by: NamrathShetty <namrath.shetty205@gmail.com>
Member
|
Hey, @NamrathShetty, sorry for the long delay here. Thanks a lot for the contribution and for your patience and hope you’ll contribute again in the future! 🙏 Cheers! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the command-line interface of the
mcp-publishertool by adding enhanced help and usage messages for both global and command-specific contexts. It introduces structured help output for each command and refactors argument parsing for better clarity and maintainability.Improvements to CLI help and usage:
--help,-h,help,--version,-v, andversionflags, displaying usage or version information as appropriate.printCommandHelpfunction, providing detailed usage, descriptions, options, and examples for each command (init,login,logout,publish).Refactoring and maintainability:
os.Args, simplifying subsequent command handling and making the code more readable.Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context
#735This pull request improves the command-line interface of the
mcp-publishertool by enhancing how help and version information is handled and by adding detailed, command-specific help messages. The changes make the tool more user-friendly and provide clearer guidance for each command.Improvements to CLI argument handling and help output:
cmd/publisher/main.goto handle global--help,-h,help,--version,-v, andversionflags before dispatching to subcommands, ensuring consistent behavior and output for these flags.--help,-h, orhelpis passed as the first argument to any subcommand, improving discoverability of command usage.Addition of detailed command-specific help:
printCommandHelpfunction incmd/publisher/main.gothat provides detailed usage, descriptions, options, and examples for each supported command (init,login,logout,publish), making it easier for users to understand and use each command correctly.