summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-16 12:25:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-16 12:25:54 -0400
commitceff04ff3e7fff4b0ea6e8ad4334cca80d291880 (patch)
treee0e7296c82dc30b8e6dab1024a645d29a5c69b36 /Command.hs
parent8fa17eaba08b99250d6290915379f048844d83d7 (diff)
better multiword parameter handling
This way, individual words as entered on the command line are available to commands.
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Command.hs b/Command.hs
index 4f835a3ad..abbe897b5 100644
--- a/Command.hs
+++ b/Command.hs
@@ -47,6 +47,8 @@ type CommandCleanup = Annex Bool
- functions. -}
type CommandSeekStrings = CommandStartString -> CommandSeek
type CommandStartString = String -> CommandStart
+type CommandSeekWords = CommandStartWords -> CommandSeek
+type CommandStartWords = [String] -> CommandStart
type CommandSeekKeys = CommandStartKey -> CommandSeek
type CommandStartKey = Key -> CommandStart
type BackendFile = (FilePath, Maybe (Backend Annex))
@@ -143,8 +145,8 @@ withFilesNotInGit a params = do
newfiles <- liftIO $ runPreserveOrder (Git.notInRepo repo) params
newfiles' <- filterFiles newfiles
backendPairs a newfiles'
-withString :: CommandSeekStrings
-withString a params = return [a $ unwords params]
+withWords :: CommandSeekWords
+withWords a params = return [a params]
withStrings :: CommandSeekStrings
withStrings a params = return $ map a params
withFilesToBeCommitted :: CommandSeekStrings