Skip to content

Commit 9c1cb6a

Browse files
committed
refactor: improve version output using SetVersionTemplate
1 parent 6b02799 commit 9c1cb6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/github-mcp-server/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
Use: "server",
3131
Short: "GitHub MCP Server",
3232
Long: `A GitHub MCP server that handles various tools and resources.`,
33-
Version: fmt.Sprintf("%s (%s) %s", version, commit, date),
33+
Version: version,
3434
}
3535

3636
stdioCmd = &cobra.Command{
@@ -64,6 +64,9 @@ var (
6464
func init() {
6565
cobra.OnInitialize(initConfig)
6666

67+
rootCmd.SetVersionTemplate(fmt.Sprintf(
68+
"GitHub MCP Server\nVersion: %s\nCommit: %s\nBuild Date: %s\n", version, commit, date))
69+
6770
// Add global flags that will be shared by all commands
6871
rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations")
6972
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")

0 commit comments

Comments
 (0)