allow the user to specify ssh key types

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2024-04-12 08:08:42 +02:00
committed by Jonathon Anderson
parent 25c0eca21a
commit ad6699c110
4 changed files with 13 additions and 3 deletions

View File

@@ -6,5 +6,5 @@ import (
)
func CobraRunE(cmd *cobra.Command, args []string) error {
return configure.SSH()
return configure.SSH(keyTypes...)
}

View File

@@ -12,6 +12,7 @@ var (
"keys.",
RunE: CobraRunE,
}
keyTypes []string
)
func init() {
@@ -19,5 +20,6 @@ func init() {
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
baseCmd.PersistentFlags().StringArrayVarP(&keyTypes, "keytypes", "t", []string{"rsa", "dsa", "ecdsa", "ed25519"}, "ssh key types to be created")
return baseCmd
}