From 00787dd853da4ffbf68edc243666c686ee3152c1 Mon Sep 17 00:00:00 2001 From: 0xdcarns Date: Thu, 24 Mar 2022 13:50:35 -0400 Subject: [PATCH] changed to lowercase --- netclient/cli_options/cmds.go | 13 +++++++++++++ netclient/cli_options/flags.go | 6 +++--- netclient/main.go | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/netclient/cli_options/cmds.go b/netclient/cli_options/cmds.go index d1da3572..849c5f24 100644 --- a/netclient/cli_options/cmds.go +++ b/netclient/cli_options/cmds.go @@ -2,6 +2,7 @@ package cli_options import ( "errors" + "fmt" "github.com/gravitl/netmaker/logger" "github.com/gravitl/netmaker/netclient/command" @@ -105,6 +106,16 @@ func GetCommands(cliFlags []cli.Flag) []*cli.Command { return err }, }, + { + Name: "verbosity", + Usage: "run netclient verb as daemon", + Flags: cliFlags, + Action: func(c *cli.Context) error { + // set max verbosity for daemon regardless + parseVerbosity(c) + return nil + }, + }, } } @@ -118,4 +129,6 @@ func parseVerbosity(c *cli.Context) { } else if c.Bool("VVV") { logger.Verbosity = 3 } + logger.Log(0, fmt.Sprintf("set verbosity to %d", logger.Verbosity)) + } diff --git a/netclient/cli_options/flags.go b/netclient/cli_options/flags.go index 081caf4c..317e014b 100644 --- a/netclient/cli_options/flags.go +++ b/netclient/cli_options/flags.go @@ -206,19 +206,19 @@ func GetFlags(hostname string) []cli.Flag { }, &cli.BoolFlag{ Name: "verbosity-level-1", - Aliases: []string{"V"}, + Aliases: []string{"v"}, Value: false, Usage: "Netclient Verbosity level 1.", }, &cli.BoolFlag{ Name: "verbosity-level-2", - Aliases: []string{"VV"}, + Aliases: []string{"vv"}, Value: false, Usage: "Netclient Verbosity level 2.", }, &cli.BoolFlag{ Name: "verbosity-level-3", - Aliases: []string{"VVV"}, + Aliases: []string{"vvv"}, Value: false, Usage: "Netclient Verbosity level 3.", }, diff --git a/netclient/main.go b/netclient/main.go index f4b92a8a..26b5427b 100644 --- a/netclient/main.go +++ b/netclient/main.go @@ -24,7 +24,7 @@ func main() { app.Commands = cli_options.GetCommands(cliFlags[:]) app.Description = "Used to perform interactions with Netmaker server and set local WireGuard config." app.Usage = "Netmaker's netclient agent and CLI." - app.UsageText = "netclient [global options] command [command options] [arguments...]. Adjust verbosity of given command with -V, -VV or -VVV (max)." + app.UsageText = "netclient [global options] command [command options] [arguments...]. Adjust verbosity of given command with -v, -vv or -vvv (max)." setGarbageCollection()