are flag symlinks/inheritance supported? #1976
Labels
area/v3
relates to / is being considered for v3
kind/question
someone asking a question
status/triage
maintainers still need to look into this
status/waiting-for-response
Waiting for response from original requester
this is either a question about v2, or a feature request for v3.
The way I currently like to organize my flags is like I've done in https://github.com/Layr-Labs/eigenda-proxy/blob/480324a0c60da9f7e498daa264cb68564f06290a/flags/flags.go#L76, where modules/packages themselves define their flags (in a cli.go file, of which there can be one per flag package if a specific sdk for eg is meant to be included in different clis that use urfave, viper, etc.) themselves, and then a cli can import all of the locally defined flags to define its own set of flags.
I prefer this approach than to have a massive flags definition flag for each CLI. One problem though is that for some CLIs, two of the subpackages define the same flags, which sometimes have different names. Whenever this happens, what I would want to do (but tried and failed) is to define some "global" or "shared" flags in my binary, hide the respective flags in the underlying packages, but still populate them from the value given to this global flag. In a sense, this would mean the subpackage flags would be "symlinked" to the global flag.
Eg:
I would want to define a shared flag, which would be inherited by the (potentially same-named) packaged flags.
The text was updated successfully, but these errors were encountered: