plushu / plushu-config

Plugin to configure environment variables for app releases
MIT License
0 stars 0 forks source link

Add `empty` subcommand #2

Closed stuartpb closed 10 years ago

stuartpb commented 10 years ago

I'm not sure whether or not this command should be added to the config plugin.

I picked the most clearly-not-a-synonym-for-unset name I could (short of something outrageous like nuke) and I added a safety check so that it will fail in the event that somebody does mistake it for unset.

The case against

As empty is more closely associated with the adjective "empty" than the verb "empty", this could be misconstrued as a condition test command ("is the config empty?"). Since plushu in general doesn't have any commands like that (and you could obviously test that with [[ -z $(plushu config $app)]]), it would be weird for someone to think that, but it's a plausible mistake that a curious cat could stumble into (once).

Ambiguity aside, it's a footgun for an uncommon task that could otherwise be accomplished with the one-liner:

plushu config $app | sed 's/=.*//g' | xargs plushu config:unset $app

The case for

The rationale being that the one-liner is a complex command requiring two network round-trips and a sed pipe step (not including all the server churn), for something that can be blindly accomplished with one character on the server. (And it's not that outrageous to consider the possibility that someone might require all-new config variables and the old config could cause problems- think of envigor in the case of multiple service providers being defined.)

stuartpb commented 10 years ago

Fuck it. :ship: