Print error if no files are given on ssh import

This commit is contained in:
Bernd Schoolmann 2024-06-03 23:54:47 +02:00
parent 1c9bf6101b
commit f7e1cae015
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,11 @@ var importSSHCmd = &cobra.Command{
Short: "Imports an SSH key into your vault", Short: "Imports an SSH key into your vault",
Long: `Imports an SSH key into your vault.`, Long: `Imports an SSH key into your vault.`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
fmt.Println("Error: No filename for SSH key specified")
return
}
filename := args[0] filename := args[0]
fmt.Println("Importing SSH key from " + filename) fmt.Println("Importing SSH key from " + filename)