This commit is contained in:
Joey Hess 2010-10-25 15:49:52 -04:00
parent 1f3088fb94
commit 3f0de706dd

View file

@ -59,14 +59,16 @@ doSubCmd cmdname start param = do
else showEndFail
{- A subcommand can broadly want one of several kinds of input parameters.
- This allows a first stage of filtering before starting a subcommand. -}
data SubCmdWants = FilesInGit | FilesNotInGit | FilesMissing | Description
data SubCommand = Command {
subcmdname :: String,
subcmdaction :: SubCmdStart,
subcmdwants :: SubCmdWants,
subcmddesc :: String
}
subCmds :: [SubCommand]
subCmds = [
(Command "add" addStart FilesNotInGit
@ -108,6 +110,7 @@ options = [
header = "Usage: git-annex " ++ (join "|" $ map subcmdname subCmds)
{- Usage message with lists of options and subcommands. -}
usage :: String
usage = usageInfo header options ++ "\nSubcommands:\n" ++ cmddescs
where