From eb99f4c608a80a32faa9707f8e0485e4a6952617 Mon Sep 17 00:00:00 2001 From: Shi Han NG Date: Fri, 26 Nov 2021 21:25:50 +0900 Subject: [PATCH] Refine flags descriptions --- README.md | 11 ++++++----- cmd/cmd.go | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5130f9..4a8fd4f 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,11 @@ variable "docker_ports" { ``` - The `-r, --resource` flag outputs all variables as `tfe_variable` - Terraform resource of [Terraform Enterprise (tfe) provider](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/variable). + resource of [Terraform Enterprise (tfe) provider](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/variable). - - The `-w, --workspace` flag outputs all variables in the payload format for the API - . + - The `-w, --workspace` flag outputs all variables in the payload format for the + [Workspace Variables API](https://www.terraform.io/docs/cloud/api/workspace-variables.html#sample-payload) + which can used together with `jq` to filter variables by key name. ``` @@ -141,13 +142,13 @@ Flags: -e, --env-var Print output in export TF_VAR_image_id=ami-abc123 format -h, --help help for tfvar --ignore-default Do not use defined default values - -r, --resource Print output in hashicorp/tfe tfe_variable resource format + -r, --resource Print output in Terraform Enterprise (tfe) provider's tfe_variable resource format --var stringArray Set a variable in the generated definitions. This flag can be set multiple times. --var-file stringArray Set variables from a file. This flag can be set multiple times. -v, --version version for tfvar - -w, --workspace Print output variables as payloads for workspace API + -w, --workspace Print output variables as payloads for Workspace Variables API ``` diff --git a/cmd/cmd.go b/cmd/cmd.go index d60251f..b7ddef9 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -51,8 +51,8 @@ one would write it in variable definitions files (.tfvars). variable definitions files e.g. terraform.tfvars[.json] *.auto.tfvars[.json]`) rootCmd.PersistentFlags().BoolP(flagDebug, "d", false, "Print debug log on stderr") rootCmd.PersistentFlags().BoolP(flagEnvVar, "e", false, "Print output in export TF_VAR_image_id=ami-abc123 format") - rootCmd.PersistentFlags().BoolP(flagResource, "r", false, "Print output in hashicorp/tfe tfe_variable resource format") - rootCmd.PersistentFlags().BoolP(flagWorkspace, "w", false, "Print output variables as payloads for workspace API") + rootCmd.PersistentFlags().BoolP(flagResource, "r", false, "Print output in Terraform Enterprise (tfe) provider's tfe_variable resource format") + rootCmd.PersistentFlags().BoolP(flagWorkspace, "w", false, "Print output variables as payloads for Workspace Variables API") rootCmd.PersistentFlags().Bool(flagNoDefault, false, "Do not use defined default values") rootCmd.PersistentFlags().StringArray(flagVar, []string{}, `Set a variable in the generated definitions. This flag can be set multiple times.`)