comments
This commit is contained in:
parent
1f3088fb94
commit
3f0de706dd
1 changed files with 4 additions and 1 deletions
|
@ -59,14 +59,16 @@ doSubCmd cmdname start param = do
|
||||||
else showEndFail
|
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 SubCmdWants = FilesInGit | FilesNotInGit | FilesMissing | Description
|
||||||
|
|
||||||
data SubCommand = Command {
|
data SubCommand = Command {
|
||||||
subcmdname :: String,
|
subcmdname :: String,
|
||||||
subcmdaction :: SubCmdStart,
|
subcmdaction :: SubCmdStart,
|
||||||
subcmdwants :: SubCmdWants,
|
subcmdwants :: SubCmdWants,
|
||||||
subcmddesc :: String
|
subcmddesc :: String
|
||||||
}
|
}
|
||||||
|
|
||||||
subCmds :: [SubCommand]
|
subCmds :: [SubCommand]
|
||||||
subCmds = [
|
subCmds = [
|
||||||
(Command "add" addStart FilesNotInGit
|
(Command "add" addStart FilesNotInGit
|
||||||
|
@ -108,6 +110,7 @@ options = [
|
||||||
|
|
||||||
header = "Usage: git-annex " ++ (join "|" $ map subcmdname subCmds)
|
header = "Usage: git-annex " ++ (join "|" $ map subcmdname subCmds)
|
||||||
|
|
||||||
|
{- Usage message with lists of options and subcommands. -}
|
||||||
usage :: String
|
usage :: String
|
||||||
usage = usageInfo header options ++ "\nSubcommands:\n" ++ cmddescs
|
usage = usageInfo header options ++ "\nSubcommands:\n" ++ cmddescs
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue