diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-16 20:03:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-16 20:03:41 -0400 |
commit | 96347a25a26d01ae4814e9eeb44e7c82a68fb560 (patch) | |
tree | afd66226d3459dd3c4f68e5862644fe3f489de8d /Commands.hs | |
parent | c69e747d383d308d0cf65d88dc1c3be139d056a9 (diff) |
show full usage
Diffstat (limited to 'Commands.hs')
-rw-r--r-- | Commands.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Commands.hs b/Commands.hs index f33be5393..b9f31a56c 100644 --- a/Commands.hs +++ b/Commands.hs @@ -67,9 +67,9 @@ parseCmd :: [String] -> AnnexState -> IO ([Flag], [Annex ()]) parseCmd argv state = do (flags, params) <- getopt case (length params) of - 0 -> error header + 0 -> error usage _ -> case (lookupCmd (params !! 0)) of - [] -> error header + [] -> error usage [Command _ action want] -> do f <- findWanted want (drop 1 params) (BackendTypes.repo state) @@ -77,10 +77,11 @@ parseCmd argv state = do where getopt = case getOpt Permute options argv of (flags, params, []) -> return (flags, params) - (_, _, errs) -> ioError (userError (concat errs ++ usageInfo header options)) + (_, _, errs) -> ioError (userError (concat errs ++ usage)) lookupCmd cmd = filter (\c -> cmd == cmdname c) cmds header = "Usage: git-annex [" ++ (join "|" $ map cmdname cmds) ++ "] ..." + usage = usageInfo header options {- Annexes a file, storing it in a backend, and then moving it into - the annex directory and setting up the symlink pointing to its content. -} |