Skip to content

Commit

Permalink
improve log (#29)
Browse files Browse the repository at this point in the history
* improve log of list command

* release v1.3.5
  • Loading branch information
adikari committed Jul 12, 2023
1 parent 57919b3 commit 83c2651
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"text/tabwriter"

"github.com/adikari/safebox/v2/config"
"github.com/adikari/safebox/v2/store"
"github.com/pkg/errors"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -58,14 +59,14 @@ func list(_ *cobra.Command, _ []string) error {
sort.Sort(ByName(configs))
}

printList(configs)
printList(configs, config)

return nil
}

func printList(configs []store.Config) {
func printList(configs []store.Config, cfg *config.Config) {
if len(configs) <= 0 {
fmt.Print("no configurations to list")
fmt.Printf("no configurations to list. stage = %s, service = %s, region = %s\n", cfg.Stage, cfg.Service, *cfg.Session.Config.Region)
return
}

Expand All @@ -87,8 +88,7 @@ func printList(configs []store.Config) {
}

fmt.Fprintln(w, "---")
fmt.Fprintf(w, "Total parameters = %d", len(configs))
fmt.Fprintln(w, "")
fmt.Fprintf(w, "Total parameters = %d, stage = %s, service = %s, region = %s\n", len(configs), cfg.Stage, cfg.Service, *cfg.Session.Config.Region)

w.Flush()
}
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adikari/safebox",
"version": "1.3.4",
"version": "1.3.5",
"description": "A Fast and Flexible secret manager built with love by adikari in Go",
"main": "index.js",
"bin": "./run.js",
Expand Down

0 comments on commit 83c2651

Please sign in to comment.