Allow options to have more aliases
felixSchl opened this issue · 2 comments
felixSchl commented
Instead of
type Option = { name :: Maybe String, flag :: Maybe Char | ... }
it could be
data Alias = Long String | Short Char
type Option = { aliases :: NonEmpty Alias | ... }
This would allow to do things like -h, -?, --help
felixSchl commented
This work is almost complete and it really showed the strength of the type system. After swapping over it revealed many edge cases that had either no been dealt with at all or had been dealt with in a awkward way, since two Maybe
s do not guarantee that one them will be a Just
.