-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add underscore variant #581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds an underscore variant (read_only
) alongside the existing read-only
flag and updates the server configuration to respect both.
- Combines
viper.GetBool("read-only")
andviper.GetBool("read_only")
when setting theReadOnly
field - Registers two CLI flags (
--read-only
and--read_only
) bound to the samereadOnlyFlag
variable
Comments suppressed due to low confidence (1)
cmd/github-mcp-server/main.go:74
- The new
read_only
alias isn’t covered by any existing tests. Consider adding unit tests to verify that both--read-only
and--read_only
correctly enable read-only mode.
rootCmd.PersistentFlags().BoolVar(&readOnlyFlag, "read_only", false, "Restrict the server to read-only operations")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be simplified and achieve the goal. Thanks for rapid fix.
Adds a normalisation function that will replace underscores with dashed in config keys.
Addresses: #577