File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import (
66 "path/filepath"
77 "strconv"
88
9+ "github.com/flanksource/clicky"
910 "github.com/samber/lo"
1011 "github.com/spf13/cobra"
1112
12- "github.com/flanksource/clicky"
1313 "github.com/flanksource/postgres/pkg"
1414 "github.com/flanksource/postgres/pkg/config"
1515 "github.com/flanksource/postgres/pkg/pgtune"
@@ -53,7 +53,8 @@ func getPostgresPassword() utils.SensitiveString {
5353}
5454
5555func main () {
56- clicky .Infof (GetVersionInfo ())
56+ clicky .Infof ("%s" , GetVersionInfo ())
57+
5758 rootCmd := & cobra.Command {
5859 Use : "postgres-cli" ,
5960 Short : "PostgreSQL Management CLI" ,
@@ -66,11 +67,12 @@ This unified tool combines PostgreSQL server management, configuration generatio
6667
6768 // Load configuration if specified
6869 if configFile != "" {
69- if pconfig , err := config .LoadPostgresConf (configFile ); err == nil {
70- return err
71- } else {
72- postgres .Config = pconfig
70+ pconfig , err := config .LoadPostgresConf (configFile )
71+ if err != nil {
72+ return fmt .Errorf ("failed to load postgres config file(%s): %w" , configFile , err )
7373 }
74+
75+ postgres .Config = pconfig
7476 } else if postgres .Config == nil {
7577 postgres .Config = config .DefaultPostgresConf ()
7678 }
You can’t perform that action at this time.
0 commit comments