mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 14:23:05 +00:00
Add debug mode and upgrade mcp-go to v0.14.1
This commit is contained in:
24
cmd/cmd.go
24
cmd/cmd.go
@@ -3,6 +3,7 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"gitea.com/gitea/gitea-mcp/operation"
|
||||
flagPkg "gitea.com/gitea/gitea-mcp/pkg/flag"
|
||||
@@ -42,6 +43,12 @@ func init() {
|
||||
"",
|
||||
"Your personal access token",
|
||||
)
|
||||
flag.BoolVar(
|
||||
&debug,
|
||||
"d",
|
||||
false,
|
||||
"debug mode",
|
||||
)
|
||||
flag.BoolVar(
|
||||
&debug,
|
||||
"debug",
|
||||
@@ -52,7 +59,24 @@ func init() {
|
||||
flag.Parse()
|
||||
|
||||
flagPkg.Host = host
|
||||
if flagPkg.Host == "" {
|
||||
flagPkg.Host = os.Getenv("GITEA_HOST")
|
||||
}
|
||||
if flagPkg.Host == "" {
|
||||
flagPkg.Host = "https://gitea.com"
|
||||
}
|
||||
|
||||
flagPkg.Token = token
|
||||
if flagPkg.Token == "" {
|
||||
flagPkg.Token = os.Getenv("GITEA_TOKEN")
|
||||
}
|
||||
|
||||
if debug {
|
||||
flagPkg.Debug = debug
|
||||
}
|
||||
if !debug {
|
||||
flagPkg.Debug = os.Getenv("GITEA_DEBUG") == "true"
|
||||
}
|
||||
}
|
||||
|
||||
func Execute(version string) {
|
||||
|
Reference in New Issue
Block a user