Skip to content

Commit

Permalink
chore: use Verbose again
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Sep 4, 2023
1 parent fd69944 commit 54bfa44
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions cmd/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions cmd/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions cmd/revert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions cmd/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 8 additions & 8 deletions internal/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -491,7 +491,7 @@ func LoadConfig(c *Config) error {
}
defer lpad.DB.Close()

if c.LogLevel > 0 {
if c.Verbose {
lpad.DB.LogMode(true)
}

Expand Down

0 comments on commit 54bfa44

Please sign in to comment.