Files
shhh/internal/clis/hmsecrets/set-arr.go
T
jmug 03247415b2
build-secretsserver / build (push) Successful in 1m39s
release-clis / release (push) Successful in 2m25s
feat: Support configuration file for hmsecrets.
2026-10-29 14:35:46 -07:00

35 lines
579 B
Go

package hmsecrets
import (
"github.com/spf13/cobra"
)
var arrValue []string
func init() {
rootCmd.AddCommand(setArrCmd)
setArrCmd.Flags().StringArrayVarP(
&arrValue,
"array-value",
"v",
nil,
"array value to store in the secret",
)
setArrCmd.MarkFlagRequired("array-value")
}
var setArrCmd = &cobra.Command{
Use: "set-array",
Short: "set-array [key]",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cli := getClient()
err := cli.PutStringArr(args[0], arrValue)
if err != nil {
return err
}
return nil
},
}