Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --prefix and --suffix Flags to ExportCommand in CLI #358

Closed
rannn505 opened this issue Feb 11, 2024 · 1 comment · Fixed by #361
Closed

Add --prefix and --suffix Flags to ExportCommand in CLI #358

rannn505 opened this issue Feb 11, 2024 · 1 comment · Fixed by #361
Assignees
Labels
feat New feature or request

Comments

@rannn505
Copy link
Contributor

rannn505 commented Feb 11, 2024

Suggestion

Enhance the ExportCommand functionality in the CLI by introducing two new optional flags: --prefix and --suffix. These flags will allow users to append a fixed string to the beginning (--prefix) or end (--suffix) of each Config Key in the export result.

Example Usage:

conifgu eval ... | configu export --prefix "MYAPP_" --suffix "_PROD"

In the above example, if we have a Config Key named DATABASE_URL, the export result would transform it into MYAPP_DATABASE_URL_PROD. This functionality is particularly useful when different environments or systems require specific naming conventions for configuration keys.

Motivation

The addition of --prefix and --suffix flags will provide users with greater control over the format of their exported configuration keys, making it easier to adapt the output for different deployment environments or system requirements.

Context

connected to #333

    prefix: Flags.string({
      description: `Append a fixed string to the beginning of each Config Key in the export result`,
    }),
    suffix: Flags.string({
      description: `Append a fixed string to the end of each Config Key in the export result`,
    }),
@rannn505 rannn505 added the feat New feature or request label Feb 11, 2024
@RonConfigu
Copy link
Contributor

RonConfigu commented Feb 13, 2024

Development Plan

  • Research
  • Add example to examples in cli/commands/export.ts
  • Add prefix and suffix flags to configu export
  • Create function keysMutations -> this func will return undefined if no --prefix or --suffix is requested or (key:string)=>string otherwise.
  • Add keys:keysMutations() to ExportCommand params
  • Update docs (if necessary)

Questions / Requests

Notes / Comments / Additional

  • Important Trying to set the --prefix to 'H' show the command help. To bypass this we must use =. eg configu export --prefix=h
    @RichardAkman | @rannn505 | @pelegpor
  • As requested by @rannn505, Casing will apply last. Including the prefix and suffix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants