From 70912c45d126b06fe52890e26040bbd180f4f3d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 25 Mar 2013 10:23:05 -0400 Subject: Group subcommands into sections in usage. Closes: #703797 --- Types/Command.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Types') diff --git a/Types/Command.hs b/Types/Command.hs index 1d64c16d1..1679dcbca 100644 --- a/Types/Command.hs +++ b/Types/Command.hs @@ -53,9 +53,9 @@ instance Eq CommandCheck where instance Eq Command where a == b = cmdname a == cmdname b -{- Order commands by name -} +{- Order commands by section and then by name -} instance Ord Command where - compare = comparing cmdname + compare = comparing (\c -> (cmdsection c, cmdname c)) {- The same sections are listed in doc/git-annex.mdwn -} data CommandSection @@ -66,3 +66,11 @@ data CommandSection | SectionUtility | SectionPlumbing deriving (Eq, Ord, Enum, Bounded) + +descSection :: CommandSection -> String +descSection SectionCommon = "Commonly used commands" +descSection SectionSetup = "Repository setup commands" +descSection SectionMaintenance = "Repository maintenance commands" +descSection SectionQuery = "Query commands" +descSection SectionUtility = "Utility commands" +descSection SectionPlumbing = "Plumbing commands" -- cgit v1.2.3