Implement command aliases#515
Conversation
0d212a3 to
9a17094
Compare
|
Some bikeshedding notes:
|
|
The microhs error is baffling me: It is complaining here: The types are: cs :: [(NonEmpty String, ParserInfo r)]
lookupCmd :: String -> [(NonEmpty String, a)] -> Maybe a🤷 |
|
Pretty sure that error is because micro haskell has a different type for any :: forall a . (a -> Bool) -> [a] -> BoolAs opposed to it being over any :: Foldable t -> (a -> Bool) -> t a -> Bool |
HuwCampbell
left a comment
There was a problem hiding this comment.
Excellent as usual. Thanks.
I'll do some tyre kicking, but I see no current issues.
Bang on, fixed now. Thanks for the review and kind words! |
|
Thanks for the merge! |
This implements the "command aliases" portion of #484 (the other part, default commands, is left for another day). My motivation is presumably similar to the OP of that issue i.e. I sometimes want shorter aliases for commands, much like we can do with options. For example:
I chose to implement this as a companion to the normal function:
since
CommandFieldsis a modifier for the command group, not an individual command, so we cannot monoidally combine names for an individual command, like we can for options.This is technically a breaking change as
Options.Applicative.Builder.Internalexports theCommandFieldsconstructor:Incidentally, it would be great to have #367, as imo this should really only require a minor bump, not a major one. I would be happy to investigate that, though there is less need for it wrt this PR, since we are already on a new major bump.
Thanks!