From 6d75b26f646967b3e5a78758ba987a532ddc8e51 Mon Sep 17 00:00:00 2001 From: Martin Nirtl Date: Fri, 31 Mar 2023 23:40:06 +0200 Subject: [PATCH] fix not fully implemented code --- cmd/rm.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/rm.go b/cmd/rm.go index 7342d11..d35acb8 100644 --- a/cmd/rm.go +++ b/cmd/rm.go @@ -37,21 +37,21 @@ var ( // TODO add interactive mode (using survey lib) if no args provided // rmCmd represents the rm command var rmCmd = &cobra.Command{ - Use: "rm [HOST...]", + Use: "rm HOST...", Short: "Remove one or more host entries from ssh-config and hosts file", Long: `Remove one or more host entries from ssh-config and hosts file. Gonna keep those files clean!`, ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { var comps []string if len(args) == 0 { - comps = cobra.AppendActiveHelp(comps, "Hit enter for interactive mode or provide one or more host names") - // comps = cobra.AppendActiveHelp(comps, "Hit enter for interactive removal or specify one or more host names here") + comps = cobra.AppendActiveHelp(comps, "Provide one or more host names") + // comps = cobra.AppendActiveHelp(comps, "Hit enter for interactive mode or provide one or more host names") } if len(args) > 0 { comps = cobra.AppendActiveHelp(comps, "Provide more host names or hit enter") } return comps, cobra.ShellCompDirectiveNoFileComp }, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { err := getFilePaths() if err != nil {