summaryrefslogtreecommitdiff
path: root/GitAnnexShell.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-02 08:35:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-02 08:35:15 -0400
commit9517fbb9488aac6750b9599db358da8d72a2343e (patch)
tree0584473638da9c38f7bc2164c17cad4aab048cdc /GitAnnexShell.hs
parentbab6dc48d3ee09036fa555fa5ddc1475c9ce87d4 (diff)
cleanup
Diffstat (limited to 'GitAnnexShell.hs')
-rw-r--r--GitAnnexShell.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/GitAnnexShell.hs b/GitAnnexShell.hs
index 559e30235..497e4cf8f 100644
--- a/GitAnnexShell.hs
+++ b/GitAnnexShell.hs
@@ -9,7 +9,6 @@ module GitAnnexShell where
import System.Environment
import System.Console.GetOpt
-import Data.Char
import Common.Annex
import qualified Git.Construct
@@ -17,6 +16,7 @@ import CmdLine
import Command
import Annex.UUID
import qualified Option
+import Fields
import qualified Command.ConfigList
import qualified Command.InAnnex
@@ -49,7 +49,6 @@ cmds = map adddirparam $ cmds_readonly ++ cmds_notreadonly
options :: [OptDescr (Annex ())]
options = Option.common ++
[ Option [] ["uuid"] (ReqArg checkuuid paramUUID) "local repository uuid"
- , Option [] ["remote-uuid"] (ReqArg checkuuid paramUUID) "remote repository uuid"
]
where
checkuuid expected = getUUID >>= check
@@ -116,12 +115,8 @@ parseFields = map (separate (== '='))
- Make sure that field values make sense. -}
checkField :: (String, String) -> IO Bool
checkField (field, value)
- | field == "remoteuuid" = return $
- -- does it look like a UUID?
- all (\c -> isAlphaNum c || c == '-') value
- | field == "associatedfile" =
- -- is the file located within the current directory?
- dirContains <$> getCurrentDirectory <*> pure value
+ | field == fieldName remoteUUID = fieldCheck remoteUUID value
+ | field == fieldName associatedFile = fieldCheck associatedFile value
| otherwise = return False
failure :: IO ()