Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaaaff4f

Browse files
JoannaaKLSamMorrowDrums
authored andcommitted
Add underscore variant
1 parent8bd7152 commitaaaff4f

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)

[8]ページ先頭

©2009-2025 Movatter.jp