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) }