From f7e1cae0150b9aeb5ab235ceb83485e0a8dbe130 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 3 Jun 2024 23:54:47 +0200 Subject: [PATCH] Print error if no files are given on ssh import --- cli/cmd/ssh.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/cmd/ssh.go b/cli/cmd/ssh.go index f50927c..76b1be9 100644 --- a/cli/cmd/ssh.go +++ b/cli/cmd/ssh.go @@ -98,6 +98,11 @@ var importSSHCmd = &cobra.Command{ Short: "Imports an SSH key into your vault", Long: `Imports an SSH key into your vault.`, Run: func(cmd *cobra.Command, args []string) { + if len(args) == 0 { + fmt.Println("Error: No filename for SSH key specified") + return + } + filename := args[0] fmt.Println("Importing SSH key from " + filename)