The Usage rendering code tries to find groups of options that can be rendered using the [--foo | --bar] syntax -- effectively, a Sum that contains at least one empty Prod. However, if it contains only empty Prods, it will render as [], which is nonstandard and not useful.
Previously, this would never arise in practise -- you'd need to write some weird opts instances like Opts("foo").withDefault("bar") to trigger it. However, as pointed out in #475, now that we have Opts.env this can arise with the much more reasonable Opts.env(...).withDefault(...).
The proposed fix is to just filter out cases where the list of alternatives in the braces is empty. I'll want to do a little more testing before I'm confident in it, though.
The
Usage
rendering code tries to find groups of options that can be rendered using the[--foo | --bar]
syntax -- effectively, aSum
that contains at least one emptyProd
. However, if it contains only emptyProd
s, it will render as[]
, which is nonstandard and not useful.Previously, this would never arise in practise -- you'd need to write some weird opts instances like
Opts("foo").withDefault("bar")
to trigger it. However, as pointed out in #475, now that we haveOpts.env
this can arise with the much more reasonableOpts.env(...).withDefault(...)
.The proposed fix is to just filter out cases where the list of alternatives in the braces is empty. I'll want to do a little more testing before I'm confident in it, though.