jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

Support JIRA_CONFG env variable

Open weshouman opened this issue 1 year ago • 5 comments

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
}

weshouman avatar Mar 04 '24 13:03 weshouman

Hi @weshouman, there is XDG_CONFIG_HOME env available, wondering if that works for your usecase?

ankitpokhrel avatar Mar 04 '24 19:03 ankitpokhrel

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
...

weshouman avatar Mar 05 '24 08:03 weshouman

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)

DimmKirr avatar May 06 '24 07:05 DimmKirr