diff options
author | Joey Hess <joey@kitenet.net> | 2010-11-04 13:28:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-11-04 13:28:49 -0400 |
commit | df4b461df1bf70016ffa02d08e822067f8544a63 (patch) | |
tree | 88b2a92daec404e607f0fd777c19d440ad6b5895 /CmdLine.hs | |
parent | 0eae5b806c76b0fa3e21fbae6e5f2d9a39a04cce (diff) |
refactor
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/CmdLine.hs b/CmdLine.hs index 494da2873..98bdab12f 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -33,12 +33,6 @@ import qualified Command.SetKey import qualified Command.Fix import qualified Command.Init -data SubCommand = SubCommand { - subcmdname :: String, - subcmdparams :: String, - subcmdseek :: SubCmdSeek, - subcmddesc :: String -} subCmds :: [SubCommand] subCmds = [ (SubCommand "add" path (withFilesNotInGit Command.Add.start) @@ -109,35 +103,6 @@ usage = usageInfo header options ++ "\nSubcommands:\n" ++ cmddescs indent l = " " ++ l pad n s = take (n - (length s)) $ repeat ' ' -{- Prepares a list of actions to run to perform a subcommand, based on - - the parameters passed to it. -} -prepSubCmd :: SubCommand -> AnnexState -> [String] -> IO [Annex Bool] -prepSubCmd SubCommand { subcmdseek = seek } state params = do - list <- Annex.eval state $ seek params - return $ map (\a -> doSubCmd a) list - -{- Runs a subcommand through the start, perform and cleanup stages -} -doSubCmd :: SubCmdStart -> SubCmdCleanup -doSubCmd start = do - s <- start - case (s) of - Nothing -> return True - Just perform -> do - p <- perform - case (p) of - Nothing -> do - showEndFail - return False - Just cleanup -> do - c <- cleanup - if (c) - then do - showEndOk - return True - else do - showEndFail - return False - {- These functions find appropriate files or other things based on a user's parameters. -} withFilesNotInGit :: SubCmdSeekBackendFiles |