feat: Subcommands for maps and array values.

This commit is contained in:
jmug committed 2026-10-24 02:28:54 -07:00
1 parent f65e0c7eaa
commit 3d0add35e3
4 files changed
+120

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
package hmsecrets
import (
"fmt"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(getMapCmd)
}
var getMapCmd = &cobra.Command{
Use: "get-map",
Short: "get-map [key]",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cli := getClient(apiBase, caFile, clientCert, clientKey)
secret, err := cli.GetStringMap(args[0])
if err != nil {
return err
}
fmt.Println(secret)
return nil
},
}