summaryrefslogtreecommitdiff
path: root/Types/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-16 16:53:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-16 16:53:44 -0400
commit990fcad9787ef5fa3b7c039c3ee01ef298b60a27 (patch)
treeb644e53ea09cc35994f6187ccd1434d802a790b6 /Types/Command.hs
parentdb6b4cdfcf67cfc3fce5e5f4323aa96a6ebd3e59 (diff)
order commands in usage by name
Diffstat (limited to 'Types/Command.hs')
-rw-r--r--Types/Command.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Types/Command.hs b/Types/Command.hs
index 6dbcf48d1..c5020d112 100644
--- a/Types/Command.hs
+++ b/Types/Command.hs
@@ -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