From 5b74b130a39d8c45e7d24520d838d6c1635582c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Oct 2011 16:31:35 -0400 Subject: refactored and generalized pre-command sanity checking --- CmdLine.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs index b1c9c1728..1037401e0 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -21,7 +21,6 @@ import qualified Git import Annex.Content import Command import Options -import Init {- Runs the passed command line. -} dispatch :: [String] -> [Command] -> [Option] -> String -> Git.Repo -> IO () @@ -41,7 +40,7 @@ parseCmd argv header cmds options = do [] -> error $ "unknown command" ++ usagemsg [command] -> do _ <- sequence flags - checkCmdEnviron command + checkCommand command prepCommand command (drop 1 params) _ -> error "internal error: multiple matching commands" where @@ -53,10 +52,6 @@ parseCmd argv header cmds options = do lookupCmd cmd = filter (\c -> cmd == cmdname c) cmds usagemsg = "\n\n" ++ usage header cmds options -{- Checks that the command can be run in the current environment. -} -checkCmdEnviron :: Command -> Annex () -checkCmdEnviron command = when (cmdusesrepo command) ensureInitialized - {- Usage message with lists of commands and options. -} usage :: String -> [Command] -> [Option] -> String usage header cmds options = -- cgit v1.2.3