From fc0e8e7581717e5ccfcc379ccd95a9f1f13cf7f6 Mon Sep 17 00:00:00 2001 From: Kenny Leung Date: Tue, 9 Jul 2024 21:33:13 -0700 Subject: [PATCH] expose keygen options Signed-off-by: Kenny Leung --- pkg/cli/keygen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cli/keygen.go b/pkg/cli/keygen.go index 952c12381..e81084e29 100644 --- a/pkg/cli/keygen.go +++ b/pkg/cli/keygen.go @@ -34,14 +34,14 @@ type KeygenContext struct { type KeygenOption func(*KeygenContext) error -func withKeyName(keyName string) KeygenOption { +func WithKeyName(keyName string) KeygenOption { return func(kc *KeygenContext) error { kc.KeyName = keyName return nil } } -func withBitSize(bitSize int) KeygenOption { +func WithBitSize(bitSize int) KeygenOption { return func(kc *KeygenContext) error { kc.BitSize = bitSize return nil @@ -84,11 +84,11 @@ func Keygen() *cobra.Command { Args: cobra.MinimumNArgs(0), RunE: func(cmd *cobra.Command, args []string) error { options := []KeygenOption{ - withBitSize(keySize), + WithBitSize(keySize), } if len(args) > 0 { - options = append(options, withKeyName(args[0])) + options = append(options, WithKeyName(args[0])) } return KeygenCmd(cmd.Context(), options...)