summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-15 22:42:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-15 22:42:34 -0400
commit2e1cc2f8b98aaf9e01b620d557c42d5b1ae2aaa6 (patch)
tree57ad758d6a1e193a2cf9974e1d4172f500548e6f /Command.hs
parentda504f647fdbec7aa3a3c08244520de2c00898ef (diff)
fixed dropkey, setkey, and git-annex-shell subcommands
key is now specified as the full key, no --backend needed
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Command.hs b/Command.hs
index 27598fff0..c3cb612ee 100644
--- a/Command.hs
+++ b/Command.hs
@@ -14,6 +14,7 @@ import Control.Monad (filterM, liftM, when)
import System.Path.WildMatch
import Text.Regex.PCRE.Light.Char8
import Data.List
+import Data.Maybe
import Types
import qualified Backend
@@ -46,6 +47,8 @@ type CommandCleanup = Annex Bool
- functions. -}
type CommandSeekStrings = CommandStartString -> CommandSeek
type CommandStartString = String -> CommandStart
+type CommandSeekKeys = CommandStartKey -> CommandSeek
+type CommandStartKey = Key -> CommandStart
type BackendFile = (FilePath, Maybe (Backend Annex))
type CommandSeekBackendFiles = CommandStartBackendFile -> CommandSeek
type CommandStartBackendFile = BackendFile -> CommandStart
@@ -167,8 +170,8 @@ withFilesUnlocked' typechanged a params = do
map (\f -> Git.workTree repo ++ "/" ++ f) typechangedfiles
unlockedfiles' <- filterFiles unlockedfiles
backendPairs a unlockedfiles'
-withKeys :: CommandSeekStrings
-withKeys a params = return $ map a params
+withKeys :: CommandSeekKeys
+withKeys a params = return $ map a $ catMaybes $ map readKey params
withTempFile :: CommandSeekStrings
withTempFile a params = return $ map a params
withNothing :: CommandSeekNothing