From 62ad13a14c1342436a1c8fe00fb4fd927c511805 Mon Sep 17 00:00:00 2001 From: nikhilsbhat Date: Sat, 13 Jan 2024 18:23:47 +0530 Subject: [PATCH] Update all shell messages with valid inputs --- cmd/agent_profiles.go | 2 +- cmd/agents.go | 2 +- cmd/artifacts.go | 2 +- cmd/backup.go | 2 +- cmd/cluster_profiles.go | 2 +- cmd/config_repos.go | 2 +- cmd/environments.go | 2 +- cmd/pipeline_groups.go | 2 +- cmd/pipelines.go | 2 +- cmd/server_configurations.go | 2 +- cmd/users.go | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/agent_profiles.go b/cmd/agent_profiles.go index 99ec12d..a4ab2c1 100644 --- a/cmd/agent_profiles.go +++ b/cmd/agent_profiles.go @@ -203,7 +203,7 @@ func deleteAgentProfileCommand() *cobra.Command { PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { profileName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete elastic-agent-profile '%s'", profileName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete elastic-agent-profile '%s' [y/n]", profileName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/agents.go b/cmd/agents.go index 6d797ee..cc06824 100644 --- a/cmd/agents.go +++ b/cmd/agents.go @@ -211,7 +211,7 @@ gocd-cli agents delete --id 938d1935-bdca-4728-83d5-e96cbf0a4f8b`, } } - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete agent '%s'", agentID) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete agent '%s' [y/n]", agentID) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/artifacts.go b/cmd/artifacts.go index 447f305..38e7a36 100644 --- a/cmd/artifacts.go +++ b/cmd/artifacts.go @@ -274,7 +274,7 @@ func deleteArtifactStoreCommand() *cobra.Command { PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { storeName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete store '%s'", storeName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete store '%s' [y/n]", storeName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/backup.go b/cmd/backup.go index c94f28b..24c6840 100644 --- a/cmd/backup.go +++ b/cmd/backup.go @@ -111,7 +111,7 @@ func deleteBackupConfig() *cobra.Command { Args: cobra.NoArgs, PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { - cliShellReadConfig.ShellMessage = "do you want to delete GoCD's backup configuration" + cliShellReadConfig.ShellMessage = "do you want to delete GoCD's backup configuration [y/n]" if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/cluster_profiles.go b/cmd/cluster_profiles.go index 4dc5536..83ee312 100644 --- a/cmd/cluster_profiles.go +++ b/cmd/cluster_profiles.go @@ -196,7 +196,7 @@ func deleteClusterProfileCommand() *cobra.Command { PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { clusterProfile := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete cluster profile '%s'", clusterProfile) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete cluster profile '%s' [y/n]", clusterProfile) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/config_repos.go b/cmd/config_repos.go index c372ac5..07ebe07 100644 --- a/cmd/config_repos.go +++ b/cmd/config_repos.go @@ -370,7 +370,7 @@ func getDeleteConfigRepoCommand() *cobra.Command { PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { configRepoName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete config repo '%s'", configRepoName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete config repo '%s' [y/n]", configRepoName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/environments.go b/cmd/environments.go index 073dedb..6dc22a8 100644 --- a/cmd/environments.go +++ b/cmd/environments.go @@ -312,7 +312,7 @@ func deleteEnvironmentCommand() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { environmentName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete gocd environment '%s'", environmentName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete gocd environment '%s' [y/n]", environmentName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/pipeline_groups.go b/cmd/pipeline_groups.go index 1cb725f..49b619d 100644 --- a/cmd/pipeline_groups.go +++ b/cmd/pipeline_groups.go @@ -202,7 +202,7 @@ func deletePipelineGroupCommand() *cobra.Command { Example: `gocd-cli pipeline-group delete movies`, RunE: func(cmd *cobra.Command, args []string) error { pipelineGroupName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete pipeline-group '%s'", pipelineGroupName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete pipeline-group '%s' [y/n]", pipelineGroupName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/pipelines.go b/cmd/pipelines.go index 7fad384..7cad096 100644 --- a/cmd/pipelines.go +++ b/cmd/pipelines.go @@ -580,7 +580,7 @@ func deletePipelineCommand() *cobra.Command { Example: `gocd-cli pipeline delete movies`, RunE: func(cmd *cobra.Command, args []string) error { pipelineName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete pipeline '%s'", pipelineName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete pipeline '%s' [y/n]", pipelineName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/server_configurations.go b/cmd/server_configurations.go index 80537ed..75f76ca 100644 --- a/cmd/server_configurations.go +++ b/cmd/server_configurations.go @@ -372,7 +372,7 @@ func deleteMailServerConfigCommand() *cobra.Command { Args: cobra.NoArgs, PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { - cliShellReadConfig.ShellMessage = "do you want to delete GoCD's mail server config" + cliShellReadConfig.ShellMessage = "do you want to delete GoCD's mail server config [y/n]" if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader() diff --git a/cmd/users.go b/cmd/users.go index a3a3f4c..4744d9c 100644 --- a/cmd/users.go +++ b/cmd/users.go @@ -161,7 +161,7 @@ func userDeleteCommand() *cobra.Command { PreRunE: setCLIClient, RunE: func(cmd *cobra.Command, args []string) error { userName := args[0] - cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete user '%s'", userName) + cliShellReadConfig.ShellMessage = fmt.Sprintf("do you want to delete user '%s' [y/n]", userName) if !cliCfg.Yes { contains, option := cliShellReadConfig.Reader()