Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Allow options to have more aliases #64

Closed
felixSchl opened this issue Jul 13, 2016 · 2 comments
Closed

Allow options to have more aliases #64

felixSchl opened this issue Jul 13, 2016 · 2 comments

Comments

@felixSchl
Copy link
Owner

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
Copy link
Owner Author

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 Maybes do not guarantee that one them will be a Just.

@felixSchl
Copy link
Owner Author

Landed via ede0daa

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant