order commands in usage by name

This commit is contained in:
Joey Hess 2012-02-16 16:53:44 -04:00
parent db6b4cdfcf
commit 990fcad978
2 changed files with 11 additions and 1 deletions

View file

@ -7,6 +7,8 @@
module Types.Command where
import Data.Ord
import Types
{- A command runs in these stages.
@ -46,3 +48,10 @@ data Command = Command
{- CommandCheck functions can be compared using their unique id. -}
instance Eq CommandCheck where
a == b = idCheck a == idCheck b
instance Eq Command where
a == b = cmdname a == cmdname b
{- Order commands by name -}
instance Ord Command where
compare = comparing cmdname