From 978e3c6bf38d9b22e48eaffe01c2c63f6d632b03 Mon Sep 17 00:00:00 2001 From: rafiramadhana Date: Tue, 19 Sep 2023 07:23:20 +0700 Subject: [PATCH] Rename to use context --- cmd/cli/{select_context.go => use_context.go} | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename cmd/cli/{select_context.go => use_context.go} (60%) diff --git a/cmd/cli/select_context.go b/cmd/cli/use_context.go similarity index 60% rename from cmd/cli/select_context.go rename to cmd/cli/use_context.go index 0ef4e7a..7ebf61d 100644 --- a/cmd/cli/select_context.go +++ b/cmd/cli/use_context.go @@ -11,17 +11,17 @@ import ( ) func init() { - configCmd.AddCommand(configSelectContextCmd) + configCmd.AddCommand(configUseContextCmd) } -var configSelectContextCmd = &cobra.Command{ - Use: "select-context ", - Short: "Select a context entry from layerform config file", - Long: `Select a context entry from layerform config file. +var configUseContextCmd = &cobra.Command{ + Use: "use-context ", + Short: "Use a context entry from layerform config file", + Long: `Use a context entry from layerform config file. - Selecting a name that does not exist will return error.`, - Example: `# Select a context -layerform config select-context local-example`, + Using a name that does not exist will return error.`, + Example: `# Use a context +layerform config use-context local-example`, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { name := args[0] @@ -36,7 +36,7 @@ layerform config select-context local-example`, if !ok { fmt.Fprintf( os.Stderr, - "context %s does not exist\n", + "no context exists with the name \"%s\".\n", name, ) os.Exit(1) @@ -50,7 +50,7 @@ layerform config select-context local-example`, os.Exit(1) } - fmt.Fprintf(os.Stdout, "Context \"%s\" selected.\n", name) + fmt.Fprintf(os.Stdout, "Switched to context \"%s\".\n", name) }, SilenceErrors: true, }