smcli env: emit URI/USERNAME/PASSWORD for consumers; pin v5
ci / vet (push) Successful in 55s

convert of login items keeps original env names in fields; env now also
exposes the login triple so sourced consumers can map to legacy names.
Ticket: https://projects.knownelement.com/issues/832
This commit is contained in:
2026-09-06 17:23:22 -05:00
parent 0dcf41a839
commit 907ddb6000
5 changed files with 30 additions and 3 deletions
+11
View File
@@ -251,6 +251,15 @@ func cmdEnv(name string) error {
v := strings.ReplaceAll(f.Value, "'", "'\\''")
fmt.Printf("export %s='%s'\n", f.Name, v)
}
if len(pc.URIs) > 0 {
fmt.Printf("export URI='%s'\n", pc.URIs[0])
}
if pc.Login.Username != "" {
fmt.Printf("export USERNAME='%s'\n", pc.Login.Username)
}
if pc.Login.Password != "" {
fmt.Printf("export PASSWORD='%s'\n", pc.Login.Password)
}
return nil
}
@@ -537,3 +546,5 @@ func cmdConvert(name string) error {
fmt.Printf("converted: %s (user=%v pass=%v uris=%d fields=%d)\n", name, username != "", password != "", len(uris), len(rest))
return nil
}
func urisOf(pc *PlainCipher) []string { return pc.URIs }