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

Commit397750b

Browse files
committed
Merge branch 'main' of github.com:JoannaaKL/github-mcp-server
2 parentsb59a27c +96f0173 commit397750b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

‎cmd/github-mcp-server/main.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import (
44
"errors"
55
"fmt"
66
"os"
7+
"strings"
78

89
"github.com/github/github-mcp-server/internal/ghmcp"
910
"github.com/github/github-mcp-server/pkg/github"
1011
"github.com/spf13/cobra"
12+
"github.com/spf13/pflag"
1113
"github.com/spf13/viper"
1214
)
1315

@@ -54,14 +56,14 @@ var (
5456
EnableCommandLogging:viper.GetBool("enable-command-logging"),
5557
LogFilePath:viper.GetString("log-file"),
5658
}
57-
5859
returnghmcp.RunStdioServer(stdioServerConfig)
5960
},
6061
}
6162
)
6263

6364
funcinit() {
6465
cobra.OnInitialize(initConfig)
66+
rootCmd.SetGlobalNormalizationFunc(wordSepNormalizeFunc)
6567

6668
rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n")
6769

@@ -91,6 +93,7 @@ func initConfig() {
9193
// Initialize Viper configuration
9294
viper.SetEnvPrefix("github")
9395
viper.AutomaticEnv()
96+
9497
}
9598

9699
funcmain() {
@@ -99,3 +102,12 @@ func main() {
99102
os.Exit(1)
100103
}
101104
}
105+
106+
funcwordSepNormalizeFunc(f*pflag.FlagSet,namestring) pflag.NormalizedName {
107+
from:= []string{"_"}
108+
to:="-"
109+
for_,sep:=rangefrom {
110+
name=strings.ReplaceAll(name,sep,to)
111+
}
112+
returnpflag.NormalizedName(name)
113+
}

‎go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require (
4141
github.com/sourcegraph/concv0.3.0// indirect
4242
github.com/spf13/aferov1.14.0// indirect
4343
github.com/spf13/castv1.7.1// indirect
44-
github.com/spf13/pflagv1.0.6// indirect
44+
github.com/spf13/pflagv1.0.6
4545
github.com/subosito/gotenvv1.6.0// indirect
4646
github.com/yosida95/uritemplate/v3v3.0.2// indirect
4747
go.uber.org/multierrv1.11.0// indirect

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp