Skip to content

Add an alias for '--secrets-file'#149

Merged
OpsBotPrime merged 1 commit intomasterfrom
rly/add-secrets-file-alias
Apr 23, 2025
Merged

Add an alias for '--secrets-file'#149
OpsBotPrime merged 1 commit intomasterfrom
rly/add-secrets-file-alias

Conversation

@rlycx
Copy link

@rlycx rlycx commented Apr 22, 2025

has this ever happened to you?

$ vaultenv -- echo "hello"
[ERROR] The option Secret file is required but not specified
$ vaultenv --secret-file foo.secrets -- echo "hello"
Invalid option `--secret-file'

Usage: vaultenv [--version] [--host HOST] [--port PORT] [--addr ADDR] 
                [--token TOKEN | --kubernetes-role ROLE | --github-token TOKEN] 
                [--secrets-file FILENAME] [CMD] [ARGS...] 
                [--no-connect-tls | --connect-tls] 
                [--no-validate-certs | --validate-certs] 
                [--no-inherit-env | --inherit-env] 
                [--inherit-env-blacklist COMMA_SEPARATED_NAMES] 
                [--retry-base-delay-milliseconds MILLISECONDS] 
                [--retry-attempts NUM] [--log-level error | info] [--use-path] 
                [--max-concurrent-requests NUM] 
                [--duplicate-variable-behavior error | keep | overwrite]

i also took the liberty of improving the "unspecified value" error message a little to mention the part of the USAGE that's missing directly

@rlycx rlycx requested a review from Riscky April 22, 2025 14:56
Copy link
Contributor

@Riscky Riscky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just improving the error message would do the trick, but I'm happy either way :)

FYI: you can specify the location of the secrets file in a .env file like this:

VAULTENV_SECRETS_FILE="foo/bar.secrets"

This prevents having to type out the location of the secrets file when running commands from the root of a project (or rather, the folder containing the .env file)

@rlycx
Copy link
Author

rlycx commented Apr 23, 2025

sweet, thx for the tip! ^^

@OpsBotPrime merge

@OpsBotPrime
Copy link
Contributor

Rebased as eae5b8f, waiting for CI …

@OpsBotPrime
Copy link
Contributor

CI job 🟡 started.

@OpsBotPrime OpsBotPrime merged commit eae5b8f into master Apr 23, 2025
1 check passed
@OpsBotPrime OpsBotPrime deleted the rly/add-secrets-file-alias branch April 23, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants