Skip to content

Commit aaaff4f

Browse files
JoannaaKLSamMorrowDrums
authored andcommitted
Add underscore variant
1 parent 8bd7152 commit aaaff4f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/github-mcp-server/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var (
4949
Token: token,
5050
EnabledToolsets: enabledToolsets,
5151
DynamicToolsets: viper.GetBool("dynamic_toolsets"),
52-
ReadOnly: viper.GetBool("read-only"),
52+
ReadOnly: viper.GetBool("read-only") || viper.GetBool("read_only"),
5353
ExportTranslations: viper.GetBool("export-translations"),
5454
EnableCommandLogging: viper.GetBool("enable-command-logging"),
5555
LogFilePath: viper.GetString("log-file"),
@@ -65,10 +65,13 @@ func init() {
6565

6666
rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n")
6767

68+
readOnlyFlag := false
69+
6870
// Add global flags that will be shared by all commands
6971
rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools, "An optional comma separated list of groups of tools to allow, defaults to enabling all")
7072
rootCmd.PersistentFlags().Bool("dynamic-toolsets", false, "Enable dynamic toolsets")
71-
rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations")
73+
rootCmd.PersistentFlags().BoolVar(&readOnlyFlag, "read-only", false, "Restrict the server to read-only operations")
74+
rootCmd.PersistentFlags().BoolVar(&readOnlyFlag, "read_only", false, "Restrict the server to read-only operations")
7275
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")
7376
rootCmd.PersistentFlags().Bool("enable-command-logging", false, "When enabled, the server will log all command requests and responses to the log file")
7477
rootCmd.PersistentFlags().Bool("export-translations", false, "Save translations to a JSON file")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy