Shameless plug: I wrote a Python library that not only lets you declaratively define all your options, but also works with config files too. Don&#x27;t write your own logic for this. Just use <a href="https:&#x2F;&#x2F;github.com&#x2F;ipartola&#x2F;groper" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ipartola&#x2F;groper</a>