From 310cbaea37d1b3a8d417633bc6f9a318b12373f8 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 13 Sep 2023 08:23:29 -0700 Subject: [PATCH] Add $GITSYNC_VERBOSE to set verbosity via env --- README.md | 2 +- main.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c1b33b3..5dbf556 100644 --- a/README.md +++ b/README.md @@ -361,7 +361,7 @@ OPTIONS The username to use for git authentication (see --password-file or --password). - -v, --verbose + -v, --verbose , $GITSYNC_VERBOSE Set the log verbosity level. Logs at this level and lower will be printed. Logs follow these guidelines: diff --git a/main.go b/main.go index 86f5924..572cb06 100644 --- a/main.go +++ b/main.go @@ -342,7 +342,8 @@ func main() { flHelp := pflag.BoolP("help", "h", false, "print help text and exit") flManual := pflag.Bool("man", false, "print the full manual and exit") - flVerbose := pflag.IntP("verbose", "v", 0, + flVerbose := pflag.IntP("verbose", "v", + envInt(0, "GITSYNC_VERBOSE"), "logs at this V level and lower will be printed") flRepo := pflag.String("repo", @@ -2506,7 +2507,7 @@ OPTIONS The username to use for git authentication (see --password-file or --password). - -v, --verbose + -v, --verbose , $GITSYNC_VERBOSE Set the log verbosity level. Logs at this level and lower will be printed. Logs follow these guidelines: