Closed alexcb closed 4 months ago
This issue has popped up many times in our use of TF and our infrastructure setup. There are many times when we need to be able to switch on and off parameters, but the templating within our systems are rudimentary, and we cannot simply perform an if
block for applying the flag as-and-when. The workarounds for this affect many layers of configuration and becomes tedious.
Merged.
welcome back @jessevdk, good to see you're still kicking.
I would like to be able to pass a value to a bool flag. I would like to be able to pass the value of the boolean like:
Which would be equivalent to calling:
I agree that the current flagging functionality is a lot cleaner than the additional functionality I'm proposing. However my use-case is to support my users who are calling my-program from a script (e.g. bash, python, etc.)
Here's an example of how I would like to use this functionality:
Where as currently my users would have to write this instead:
Note that in contrast to https://github.com/jessevdk/go-flags/issues/80 I am not suggesting the ability to change the default value of a bool flag.
If you're open to such a feature, I would be happy to contribute a PR and could make this functionality optional via a:
option.
(for reference my real use-case is to support https://github.com/earthly/earthly/issues/1109 and not bash, but it covers a very similar use-case).