Is it possible to bind multiple envname using one Option * instance?
For compatibility, I set multiple names for a flag/option.
auto option = group->add_flag("--name-a,--name-b", ...).
But for now it seems that binding multiple envname to one Option instance is impossible.
option->envname("NAME_A,NAME_B");
// or
option->envname("NAME_A")->envname("NAME_B")
even though writing two options is possible, but is there a better way to do this?
group->add_flag("--name-a", ...)->envname("NAME_A").
group->add_flag("--name-b", ...)->envname("NAME_B").
Is there any plan for this?
I don't think there are any plans to change this.
The best option is likely to be separate flags that assign to the same variable like you did.
supporting it like you describe would add a lot of complexity for limited benefit, especially since there is a straightforward alternate path to achieve the same result.
Maybe using this form is ok:
envname("NAME_A,NAME_B")
Will you merge this change if I create a PR for this?
would have to leave to @henryiii to decide.
This is actually rather nicely symmetric with how we currently handle multiple option names. I think I'd be fine with it if it didn't add much complexity.