mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 14:23:05 +00:00
fix debug mode default value (#29)
Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/29
This commit is contained in:
25
cmd/cmd.go
25
cmd/cmd.go
@@ -16,7 +16,7 @@ var (
|
|||||||
port int
|
port int
|
||||||
token string
|
token string
|
||||||
|
|
||||||
debug bool
|
debug *bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -50,17 +50,14 @@ func init() {
|
|||||||
"",
|
"",
|
||||||
"Your personal access token",
|
"Your personal access token",
|
||||||
)
|
)
|
||||||
flag.BoolVar(
|
flag.BoolFunc(
|
||||||
&debug,
|
|
||||||
"d",
|
"d",
|
||||||
true,
|
"debug mode (If -d flag is provided, debug mode will be enabled by default)",
|
||||||
"debug mode",
|
func(string) error {
|
||||||
)
|
debug = new(bool)
|
||||||
flag.BoolVar(
|
*debug = true
|
||||||
&debug,
|
return nil
|
||||||
"debug",
|
},
|
||||||
true,
|
|
||||||
"debug mode",
|
|
||||||
)
|
)
|
||||||
flag.BoolVar(
|
flag.BoolVar(
|
||||||
&flagPkg.Insecure,
|
&flagPkg.Insecure,
|
||||||
@@ -85,10 +82,10 @@ func init() {
|
|||||||
|
|
||||||
flagPkg.Mode = transport
|
flagPkg.Mode = transport
|
||||||
|
|
||||||
if debug {
|
if debug != nil && *debug {
|
||||||
flagPkg.Debug = debug
|
flagPkg.Debug = *debug
|
||||||
}
|
}
|
||||||
if !debug {
|
if debug != nil && !*debug {
|
||||||
flagPkg.Debug = os.Getenv("GITEA_DEBUG") == "true"
|
flagPkg.Debug = os.Getenv("GITEA_DEBUG") == "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user