summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-01 17:18:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-01 17:18:32 -0400
commit287e6e5c1328071ec9b934f75d5250b37a066afe (patch)
treef50d7b50145aaa93936e566efea4ccf6a91e8230
parent15e7d5913757ca8a76cbd83b3626a463fdea1767 (diff)
bring back param descriptions in usage
-rw-r--r--Commands.hs29
1 files changed, 18 insertions, 11 deletions
diff --git a/Commands.hs b/Commands.hs
index 99de9bbc8..80b355f79 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -49,34 +49,39 @@ type SubCmdCleanup = Annex Bool
data SubCommand = SubCommand {
subcmdname :: String,
+ subcmdparams :: String,
subcmdparse :: SubCmdParse,
subcmddesc :: String
}
subCmds :: [SubCommand]
subCmds = [
- (SubCommand "add" (withFilesNotInGit addStart)
+ (SubCommand "add" path (withFilesNotInGit addStart)
"add files to annex")
- , (SubCommand "get" (withFilesInGit getStart)
+ , (SubCommand "get" path (withFilesInGit getStart)
"make content of annexed files available")
- , (SubCommand "drop" (withFilesInGit dropStart)
+ , (SubCommand "drop" path (withFilesInGit dropStart)
"indicate content of files not currently wanted")
- , (SubCommand "move" (withFilesInGit moveStart)
+ , (SubCommand "move" path (withFilesInGit moveStart)
"transfer content of files to/from another repository")
- , (SubCommand "init" (withDescription initStart)
+ , (SubCommand "init" desc (withDescription initStart)
"initialize git-annex with repository description")
- , (SubCommand "unannex" (withFilesInGit unannexStart)
+ , (SubCommand "unannex" path (withFilesInGit unannexStart)
"undo accidential add command")
- , (SubCommand "fix" (withFilesInGit fixStart)
+ , (SubCommand "fix" path (withFilesInGit fixStart)
"fix up symlinks to point to annexed content")
- , (SubCommand "pre-commit" (withFilesToBeCommitted fixStart)
+ , (SubCommand "pre-commit" path (withFilesToBeCommitted fixStart)
"fix up symlinks before they are committed")
- , (SubCommand "fromkey" (withFilesMissing fromKeyStart)
+ , (SubCommand "fromkey" key (withFilesMissing fromKeyStart)
"adds a file using a specific key")
- , (SubCommand "dropkey" (withKeys dropKeyStart)
+ , (SubCommand "dropkey" key (withKeys dropKeyStart)
"drops annexed content for specified keys")
- , (SubCommand "setkey" (withTempFile setKeyStart)
+ , (SubCommand "setkey" key (withTempFile setKeyStart)
"sets annexed content for a key using a temp file")
]
+ where
+ path = "PATH ..."
+ key = "KEY ..."
+ desc = "DESCRIPTION"
-- Each dashed command-line option results in generation of an action
-- in the Annex monad that performs the necessary setting.
@@ -112,6 +117,8 @@ usage = usageInfo header options ++ "\nSubcommands:\n" ++ cmddescs
showcmd c =
(subcmdname c) ++
(pad 11 (subcmdname c)) ++
+ (subcmdparams c) ++
+ (pad 13 (subcmdparams c)) ++
(subcmddesc c)
indent l = " " ++ l
pad n s = take (n - (length s)) $ repeat ' '