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

Commitdeacd75

Browse files
committed
feat: add version subcommand to display build metadata
1 parent1a6e33e commitdeacd75

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,26 @@ var (
3939
logFile:=viper.GetString("log-file")
4040
readOnly:=viper.GetBool("read-only")
4141
exportTranslations:=viper.GetBool("export-translations")
42+
logCommands:=viper.GetBool("enable-command-logging")
43+
4244
logger,err:=initLogger(logFile)
4345
iferr!=nil {
4446
stdlog.Fatal("Failed to initialize logger:",err)
4547
}
46-
logCommands:=viper.GetBool("enable-command-logging")
48+
4749
iferr:=runStdioServer(readOnly,logger,logCommands,exportTranslations);err!=nil {
4850
stdlog.Fatal("failed to run stdio server:",err)
4951
}
5052
},
5153
}
54+
55+
versionCmd=&cobra.Command{
56+
Use:"version",
57+
Short:"Print version information",
58+
Run:func(_*cobra.Command,_ []string) {
59+
fmt.Printf("GitHub MCP Server\nVersion: %s\nCommit: %s\nBuild Date: %s\n",version,commit,date)
60+
},
61+
}
5262
)
5363

5464
funcinit() {
@@ -70,6 +80,7 @@ func init() {
7080

7181
// Add subcommands
7282
rootCmd.AddCommand(stdioCmd)
83+
rootCmd.AddCommand(versionCmd)
7384
}
7485

7586
funcinitConfig() {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp