From 3636e55604e7651d0d61b4af25c5f30d6ad5d18c Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Sat, 26 Nov 2022 17:38:00 -0500 Subject: [PATCH] rename substitute flag to expand and add to docs --- cli/packages/cmd/root.go | 2 +- cli/packages/cmd/run.go | 6 +++--- docs/cli/reference/run.mdx | 9 +++++---- docs/cli/usage.mdx | 9 +++++---- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cli/packages/cmd/root.go b/cli/packages/cmd/root.go index f33cbb249..826ccb4df 100644 --- a/cli/packages/cmd/root.go +++ b/cli/packages/cmd/root.go @@ -15,7 +15,7 @@ var rootCmd = &cobra.Command{ Short: "Infisical CLI is used to inject environment variables into any process", Long: `Infisical is a simple, end-to-end encrypted service that enables teams to sync and manage their environment variables across their development life cycle.`, CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true}, - Version: "0.1.4", + Version: "0.1.5", } // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go index d9ed47a36..6b44fa548 100644 --- a/cli/packages/cmd/run.go +++ b/cli/packages/cmd/run.go @@ -33,7 +33,7 @@ var runCmd = &cobra.Command{ return } - substitute, err := cmd.Flags().GetBool("substitute") + shouldExpandSecrets, err := cmd.Flags().GetBool("expand") if err != nil { log.Errorln("Unable to parse the substitute flag") log.Debugln(err) @@ -89,7 +89,7 @@ var runCmd = &cobra.Command{ } } - if substitute { + if shouldExpandSecrets { substitutions := util.SubstituteSecrets(envsFromApi) execCmd(args[0], args[1:], substitutions) } else { @@ -103,7 +103,7 @@ func init() { rootCmd.AddCommand(runCmd) runCmd.Flags().StringP("env", "e", "dev", "Set the environment (dev, prod, etc.) from which your secrets should be pulled from") runCmd.Flags().String("projectId", "", "The project ID from which your secrets should be pulled from") - runCmd.Flags().Bool("substitute", true, "Parse shell variable substitutions in your secrets") + runCmd.Flags().Bool("expand", true, "Parse shell parameter expansions in your secrets") } // Credit: inspired by AWS Valut diff --git a/docs/cli/reference/run.mdx b/docs/cli/reference/run.mdx index 104a5caf7..7fb207612 100644 --- a/docs/cli/reference/run.mdx +++ b/docs/cli/reference/run.mdx @@ -12,7 +12,8 @@ Inject environment variables from the platform into an application process. ## Options -| Option | Description | Default value | -| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------- | -| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` | -| `--projectId` | Used to link a local project to the platform (required only if injecting via the service token method) | `None` | +| Option | Description | Default value | +| -------------- | ----------------------------------------------------------------------------------------------------------- | ------------- | +| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` | +| `--projectId` | Used to link a local project to the platform (required only if injecting via the service token method) | `None` | +| `--expand` | Parse shell parameter expansions in your secrets (e.g., `${DOMAIN}`) | `true` | diff --git a/docs/cli/usage.mdx b/docs/cli/usage.mdx index 6b1b30b7d..ea7180068 100644 --- a/docs/cli/usage.mdx +++ b/docs/cli/usage.mdx @@ -29,10 +29,11 @@ infisical run -- [your application start command] Options you can specify: -| Option | Description | Default value | -| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------- | -| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` | -| `--projectId` | Used to link a local project to the platform (required only if injecting via the service token method) | `None` | +| Option | Description | Default value | +| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------- | +| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` | +| `--projectId` | Used to link a local project to the platform (required only if injecting via the service token method) | `None` | +| `--expand` | Parse shell parameter expansions in your secrets (e.g., `${DOMAIN}`) | `true` | ## Examples: