enhancement: streamline command handling and enhance help output #748
+93
−9
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.