Here, store_into calls flag function, and then store_into sets the options.my_opt value to false, making initial value lost.
The use case is that I want to provide the recommended defaults for all the application options with the ability to override them. That means, some bool variables can be true by default instead of false and can be overridden with -opt=false syntax. This isn't possible with flags, and store_into for bools assumes exactly flags. This assumption is quite not for everyone.
Reproduction code:
Here,
store_into
callsflag
function, and thenstore_into
sets theoptions.my_opt
value to false, making initial value lost.The use case is that I want to provide the recommended defaults for all the application options with the ability to override them. That means, some bool variables can be true by default instead of false and can be overridden with
-opt=false
syntax. This isn't possible with flags, andstore_into
for bools assumes exactly flags. This assumption is quite not for everyone.