Skip to content

Commit 7eff904

Browse files
chore: improve --version command
1 parent ea19581 commit 7eff904

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: cmd/github-mcp-server/main.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var (
2929
Use: "server",
3030
Short: "GitHub MCP Server",
3131
Long: `A GitHub MCP server that handles various tools and resources.`,
32-
Version: version,
32+
Version: fmt.Sprintf("Version: %s\nCommit: %s\nBuild Date: %s", version, commit, date),
3333
}
3434

3535
stdioCmd = &cobra.Command{
@@ -65,8 +65,7 @@ var (
6565
func init() {
6666
cobra.OnInitialize(initConfig)
6767

68-
rootCmd.SetVersionTemplate(fmt.Sprintf(
69-
"GitHub MCP Server\nVersion: %s\nCommit: %s\nBuild Date: %s\n", version, commit, date))
68+
rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n")
7069

7170
// Add global flags that will be shared by all commands
7271
rootCmd.PersistentFlags().StringSlice("toolsets", github.DefaultTools, "An optional comma separated list of groups of tools to allow, defaults to enabling all")

0 commit comments

Comments
 (0)