From 54bfa44291c297d7262e61ed597f4bc4c6e3d8de Mon Sep 17 00:00:00 2001 From: blacktop Date: Sun, 3 Sep 2023 21:25:45 -0600 Subject: [PATCH] chore: use Verbose again --- cmd/default.go | 10 +++++----- cmd/load.go | 10 +++++----- cmd/revert.go | 8 ++++---- cmd/save.go | 8 ++++---- internal/command/command.go | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cmd/default.go b/cmd/default.go index 1ec9423..8686c1e 100644 --- a/cmd/default.go +++ b/cmd/default.go @@ -66,11 +66,11 @@ var defaultCmd = &cobra.Command{ } conf := &command.Config{ - Cmd: cmd.Use, - File: Config, - Cloud: UseICloud, - Backup: backup, - LogLevel: setLogLevel(Verbose), + Cmd: cmd.Use, + File: Config, + Cloud: UseICloud, + Backup: backup, + Verbose: Verbose, } if err := conf.Verify(); err != nil { diff --git a/cmd/load.go b/cmd/load.go index 1f680f5..8fd50fe 100644 --- a/cmd/load.go +++ b/cmd/load.go @@ -66,11 +66,11 @@ var loadCmd = &cobra.Command{ } conf := &command.Config{ - Cmd: cmd.Use, - File: Config, - Cloud: UseICloud, - Backup: backup, - LogLevel: setLogLevel(Verbose), + Cmd: cmd.Use, + File: Config, + Cloud: UseICloud, + Backup: backup, + Verbose: Verbose, } if err := conf.Verify(); err != nil { diff --git a/cmd/revert.go b/cmd/revert.go index 2ba3a56..a252256 100644 --- a/cmd/revert.go +++ b/cmd/revert.go @@ -41,10 +41,10 @@ var revertCmd = &cobra.Command{ } conf := &command.Config{ - Cmd: cmd.Use, - File: Config, - Cloud: UseICloud, - LogLevel: setLogLevel(Verbose), + Cmd: cmd.Use, + File: Config, + Cloud: UseICloud, + Verbose: Verbose, } if err := conf.Verify(); err != nil { diff --git a/cmd/save.go b/cmd/save.go index ab547de..e1a24e7 100644 --- a/cmd/save.go +++ b/cmd/save.go @@ -41,10 +41,10 @@ var saveCmd = &cobra.Command{ } conf := &command.Config{ - Cmd: cmd.Use, - File: Config, - Cloud: UseICloud, - LogLevel: setLogLevel(Verbose), + Cmd: cmd.Use, + File: Config, + Cloud: UseICloud, + Verbose: Verbose, } if err := conf.Verify(); err != nil { diff --git a/internal/command/command.go b/internal/command/command.go index 3556cad..acc3b1c 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -23,11 +23,11 @@ const bold = "\033[1m%s\033[0m" // Config is the command config type Config struct { - Cmd string - File string - Cloud bool - Backup bool - LogLevel int + Cmd string + File string + Cloud bool + Backup bool + Verbose bool } // Verify will verify the command config @@ -205,7 +205,7 @@ func DefaultOrg(c *Config) (err error) { } defer lpad.DB.Close() - if c.LogLevel > 0 { + if c.Verbose { lpad.DB.LogMode(true) } @@ -343,7 +343,7 @@ func SaveConfig(c *Config) (err error) { } defer lpad.DB.Close() - if c.LogLevel > 0 { + if c.Verbose { lpad.DB.LogMode(true) } @@ -491,7 +491,7 @@ func LoadConfig(c *Config) error { } defer lpad.DB.Close() - if c.LogLevel > 0 { + if c.Verbose { lpad.DB.LogMode(true) }