Browse Source

changed to lowercase

0xdcarns 3 years ago
parent
commit
00787dd853
3 changed files with 17 additions and 4 deletions
  1. 13 0
      netclient/cli_options/cmds.go
  2. 3 3
      netclient/cli_options/flags.go
  3. 1 1
      netclient/main.go

+ 13 - 0
netclient/cli_options/cmds.go

@@ -2,6 +2,7 @@ package cli_options
 
 
 import (
 import (
 	"errors"
 	"errors"
+	"fmt"
 
 
 	"github.com/gravitl/netmaker/logger"
 	"github.com/gravitl/netmaker/logger"
 	"github.com/gravitl/netmaker/netclient/command"
 	"github.com/gravitl/netmaker/netclient/command"
@@ -105,6 +106,16 @@ func GetCommands(cliFlags []cli.Flag) []*cli.Command {
 				return err
 				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") {
 	} else if c.Bool("VVV") {
 		logger.Verbosity = 3
 		logger.Verbosity = 3
 	}
 	}
+	logger.Log(0, fmt.Sprintf("set verbosity to %d", logger.Verbosity))
+
 }
 }

+ 3 - 3
netclient/cli_options/flags.go

@@ -206,19 +206,19 @@ func GetFlags(hostname string) []cli.Flag {
 		},
 		},
 		&cli.BoolFlag{
 		&cli.BoolFlag{
 			Name:    "verbosity-level-1",
 			Name:    "verbosity-level-1",
-			Aliases: []string{"V"},
+			Aliases: []string{"v"},
 			Value:   false,
 			Value:   false,
 			Usage:   "Netclient Verbosity level 1.",
 			Usage:   "Netclient Verbosity level 1.",
 		},
 		},
 		&cli.BoolFlag{
 		&cli.BoolFlag{
 			Name:    "verbosity-level-2",
 			Name:    "verbosity-level-2",
-			Aliases: []string{"VV"},
+			Aliases: []string{"vv"},
 			Value:   false,
 			Value:   false,
 			Usage:   "Netclient Verbosity level 2.",
 			Usage:   "Netclient Verbosity level 2.",
 		},
 		},
 		&cli.BoolFlag{
 		&cli.BoolFlag{
 			Name:    "verbosity-level-3",
 			Name:    "verbosity-level-3",
-			Aliases: []string{"VVV"},
+			Aliases: []string{"vvv"},
 			Value:   false,
 			Value:   false,
 			Usage:   "Netclient Verbosity level 3.",
 			Usage:   "Netclient Verbosity level 3.",
 		},
 		},

+ 1 - 1
netclient/main.go

@@ -24,7 +24,7 @@ func main() {
 	app.Commands = cli_options.GetCommands(cliFlags[:])
 	app.Commands = cli_options.GetCommands(cliFlags[:])
 	app.Description = "Used to perform interactions with Netmaker server and set local WireGuard config."
 	app.Description = "Used to perform interactions with Netmaker server and set local WireGuard config."
 	app.Usage = "Netmaker's netclient agent and CLI."
 	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()
 	setGarbageCollection()