confique icon indicating copy to clipboard operation
confique copied to clipboard

empty strings for env bools

Open jdx opened this issue 1 year ago • 2 comments

I think empty strings should be the same as not defined, e.g.:

$ COLOR= mycli

Users commonly use an empty string in env vars like this since it's easier than removing them. I think potentially this could be configurable (somehow) like viper does.

jdx avatar Jan 06 '24 23:01 jdx

I'm a bit uncomfortable pushing this. Conflating "doesn't exist" with "empty string" doesn't sit right with me. It's not impossible to imagine a scenario where setting a value to an empty string is desired. And at least I personally am not familiar with the "set to empty string as that's easier than unsetting" idiom (which doesn't mean much, just FYI).

So yes, if this feature is added at all, it needs to be configurable. With the current behavior as the default I assume...

LukasKalbertodt avatar Mar 03 '24 19:03 LukasKalbertodt

as an example, if I want to set MISE_DEBUG and MISE_TRACE to the default I'd like to do the following:

MISE_DEBUG= MISE_TRACE= mise ...

but with the way confique deals with booleans currently I can't do this, I have to pick true or false

jdx avatar Sep 03 '24 19:09 jdx