global verbose flag.

This commit is contained in:
fiatjaf
2025-01-30 16:06:16 -03:00
parent 81571c6952
commit df5ebd3f56
2 changed files with 18 additions and 5 deletions

13
main.go
View File

@@ -63,6 +63,19 @@ var app = &cli.Command{
return nil
},
},
&cli.BoolFlag{
Name: "verbose",
Usage: "print more stuff than normally",
Aliases: []string{"v"},
Persistent: true,
Action: func(ctx context.Context, c *cli.Command, b bool) error {
v := c.Count("verbose")
if v >= 1 {
logverbose = log
}
return nil
},
},
},
Before: func(ctx context.Context, c *cli.Command) error {
configPath := c.String("config-path")