Files
shhh/internal/clis/hmsecrets/get.go
T

27 lines
434 B
Go

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