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

Env loading incorrect variable into field #60

Closed
jeggy opened this issue May 14, 2021 · 4 comments · Fixed by #61
Closed

Env loading incorrect variable into field #60

jeggy opened this issue May 14, 2021 · 4 comments · Fixed by #61
Assignees
Labels
breaking Contains breaking changes bug Something isn't working
Milestone

Comments

@jeggy
Copy link
Member

jeggy commented May 14, 2021

This example below is straight forward, but it fails as some how USER get's mapped into --db-user

@Test fun `should only use fully qualified env name`() {
    MockSystem("USER" to "jeggy")
    object: Arkenv() {
        val user: String by argument("--db-user") {
            defaultValue = { "postgres" }
        }
    }.parse().user shouldBeEqualTo "postgres"
}
@AndreasVolkmann
Copy link
Collaborator

I see, I did a recent change that always includes the field name in the name list.

You would like to preserve the old behavior?

@AndreasVolkmann AndreasVolkmann self-assigned this May 14, 2021
@AndreasVolkmann AndreasVolkmann added bug Something isn't working breaking Contains breaking changes labels May 14, 2021
@AndreasVolkmann AndreasVolkmann added this to the 3.3.1 milestone May 14, 2021
@jeggy
Copy link
Member Author

jeggy commented May 14, 2021

I ran into this issue and I couldn't spot the issue myself right away, so maybe it should be disabled if atleast 1 parameter is passed to the argument function?

Or it could be an option that could be controlled via the configureArken DSL.

@AndreasVolkmann
Copy link
Collaborator

Yes the configure option sounds good.
Which behavior should be default?
I would say the old one.

@jeggy
Copy link
Member Author

jeggy commented May 14, 2021

I'm fine with either

it could also be instead of configuring it in the configureArkenv it could be done within the Argument<T> DSL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Contains breaking changes bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants