add --silent global option to remove the stderr logs.

This commit is contained in:
fiatjaf
2023-11-13 15:03:27 -03:00
parent 11fe6b5809
commit 8fbfdc65c8
4 changed files with 27 additions and 10 deletions

13
main.go
View File

@@ -19,6 +19,19 @@ var app = &cli.App{
encode,
verify,
},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "silent",
Usage: "do not print logs and info messages to stderr",
Aliases: []string{"s"},
Action: func(ctx *cli.Context, b bool) error {
if b {
log = func(msg string, args ...any) {}
}
return nil
},
},
},
}
func main() {