jira-cli
jira-cli copied to clipboard
Support JIRA_CONFG env variable
Is your feature request related to a problem? Please describe. Managing multiple boards (or even multiple servers) would require setting the configuration flag every time.
Describe the solution you'd like
Exposing JIRA_CONFIG env variable which if set, the configuration file in it would be used.
Describe alternatives you've considered
Setting the -c config-file directly
Additional context It's possible to define a bash function that wrap the command like the following but it would be much cleaner if that's supported natively
jira() {
if [ -n "$JIRA_CONFIG" ]; then
# JIRA_CONFIG is set, use it with --config
command jira --config "${JIRA_CONFIG}" "$@"
else
# JIRA_CONFIG is not set, call jira normally
command jira "$@"
fi
}
Hi @weshouman, there is XDG_CONFIG_HOME env available, wondering if that works for your usecase?
Hello @ankitpokhrel, XDG_CONFIG_HOME would require having multiple dirs to have multiple configurations, while the -c flag allows having multiple configurations even in the same directory, I currently work around that by the provided snippet.
Note: may environment includes something like
$CONFIG_DIR/.jira/config1.config.yaml
$CONFIG_DIR/.jira/config2.config.yaml
...
My usecase for this is to have jira/repo project mapping in the repo .envrc. XDG_CONFIG_HOME wouldn't work as it would set config directories for all other tools (such as podman)