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

Commita2e662a

Browse files
committed
fix issue with log-file arg
1 parent62b20f7 commita2e662a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

‎cmd/server/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ var (
2121
Use:"server",
2222
Short:"GitHub MCP Server",
2323
Long:`A GitHub MCP server that handles various tools and resources.`,
24-
PersistentPreRun:func(cmd*cobra.Command,args []string) {
25-
// Bind flag to viper
26-
viper.BindPFlag("log-file",cmd.PersistentFlags().Lookup("log-file"))
27-
},
2824
}
2925

3026
stdioCmd=&cobra.Command{
@@ -50,6 +46,9 @@ func init() {
5046
// Add global flags that will be shared by all commands
5147
rootCmd.PersistentFlags().String("log-file","","Path to log file")
5248

49+
// Bind flag to viper
50+
viper.BindPFlag("log-file",rootCmd.PersistentFlags().Lookup("log-file"))
51+
5352
// Add subcommands
5453
rootCmd.AddCommand(stdioCmd)
5554
}

‎go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/sirupsen/logrusv1.9.3
99
github.com/spf13/cobrav1.9.1
1010
github.com/spf13/viperv1.19.0
11+
golang.org/x/expv0.0.0-20230905200255-921286631fa9
1112
)
1213

1314
require (
@@ -28,7 +29,6 @@ require (
2829
github.com/subosito/gotenvv1.6.0// indirect
2930
go.uber.org/atomicv1.9.0// indirect
3031
go.uber.org/multierrv1.9.0// indirect
31-
golang.org/x/expv0.0.0-20230905200255-921286631fa9// indirect
3232
golang.org/x/sysv0.18.0// indirect
3333
golang.org/x/textv0.14.0// indirect
3434
gopkg.in/ini.v1v1.67.0// indirect

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp