From 8898089e116c11644b9d6f08a6ae1722f7ca43a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 5 Feb 2025 10:53:01 +0100 Subject: [PATCH] pd-ctl: check for too many arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniƫl van Eeden --- tools/pd-ctl/pdctl/command/unsafe_command.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/pd-ctl/pdctl/command/unsafe_command.go b/tools/pd-ctl/pdctl/command/unsafe_command.go index 04d272385e7..6731dec5c4e 100644 --- a/tools/pd-ctl/pdctl/command/unsafe_command.go +++ b/tools/pd-ctl/pdctl/command/unsafe_command.go @@ -82,6 +82,13 @@ func removeFailedStoresCommandFunc(cmd *cobra.Command, args []string) { return } + // This is to detect " " instead of "," + if len(args) > 1 { + cmd.Println("More arguments than expected") + cmd.Usage() + return + } + strStores := strings.Split(args[0], ",") var stores []uint64 for _, strStore := range strStores {