Flag / Env / Config / Default argument ordering #566
Unanswered
AlephEleven
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Are there any solutions to prioritize args as
Command-line flag (e.g., --debug true)
Environment variable (e.g., DEBUG=true)
Configuration file (e.g., debug: true in config.yaml)
A sensible default (e.g., false)
The current solution I have swaps env / file:
flag
file
env
default
Saw this discussion on https://danielms.site/zet/2023/kong-is-an-amazing-cli-for-go-apps/ and wanted to bring it up.
Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions