Add vctl and vctx Vault token CLIs #1

Merged
benvin merged 2 commits from benvin/vault-tools-initial into main 2026-07-27 00:46:55 +10:00
Showing only changes of commit bffbd45204 - Show all commits
+3 -3
View File
@@ -241,13 +241,13 @@ func runList(w io.Writer) error {
}
names := cfg.ContextNames()
if len(names) == 0 {
fmt.Fprintf(w, "no contexts configured in %s\n", cfg.Path())
_, _ = fmt.Fprintf(w, "no contexts configured in %s\n", cfg.Path())
return nil
}
for _, name := range names {
rc, err := cfg.Resolve(name)
if err != nil {
fmt.Fprintf(w, "%-24s %v\n", name, err)
_, _ = fmt.Fprintf(w, "%-24s %v\n", name, err)
continue
}
status := "no token"
@@ -263,7 +263,7 @@ func runList(w io.Writer) error {
status = "token cached"
}
}
fmt.Fprintf(w, "%-24s %-40s %s\n", name, rc.Address, status)
_, _ = fmt.Fprintf(w, "%-24s %-40s %s\n", name, rc.Address, status)
}
return nil
}