diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-11 00:51:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-11 00:51:07 -0400 |
commit | 264bd9ebe37855d4005022df057da13ec8080afb (patch) | |
tree | f32f13646ece29c8f6336b8680cb07dd55187be5 /GitAnnexShell.hs | |
parent | d9f5cc9f73ea046fcd2b59b5e75d4600593ac05b (diff) |
where indenting
Diffstat (limited to 'GitAnnexShell.hs')
-rw-r--r-- | GitAnnexShell.hs | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/GitAnnexShell.hs b/GitAnnexShell.hs index 42841a647..f77347a1c 100644 --- a/GitAnnexShell.hs +++ b/GitAnnexShell.hs @@ -44,24 +44,22 @@ cmds_notreadonly = concat cmds :: [Command] cmds = map adddirparam $ cmds_readonly ++ cmds_notreadonly - where - adddirparam c = c - { cmdparamdesc = "DIRECTORY " ++ cmdparamdesc c - } + where + adddirparam c = c { cmdparamdesc = "DIRECTORY " ++ cmdparamdesc c } options :: [OptDescr (Annex ())] options = Option.common ++ [ Option [] ["uuid"] (ReqArg checkuuid paramUUID) "local repository uuid" ] - where - checkuuid expected = getUUID >>= check - where - check u | u == toUUID expected = noop - check NoUUID = unexpected "uninitialized repository" - check u = unexpected $ "UUID " ++ fromUUID u - unexpected s = error $ - "expected repository UUID " ++ - expected ++ " but found " ++ s + where + checkuuid expected = getUUID >>= check + where + check u | u == toUUID expected = noop + check NoUUID = unexpected "uninitialized repository" + check u = unexpected $ "UUID " ++ fromUUID u + unexpected s = error $ + "expected repository UUID " ++ + expected ++ " but found " ++ s header :: String header = "Usage: git-annex-shell [-c] command [parameters ...] [option ..]" @@ -152,20 +150,20 @@ checkDirectory mdir = do if d' `equalFilePath` dir' then noop else req d' (Just dir') - where - req d mdir' = error $ unwords - [ "Only allowed to access" - , d - , maybe "and could not determine directory from command line" ("not " ++) mdir' - ] - - {- A directory may start with ~/ or in some cases, even /~/, - - or could just be relative to home, or of course could - - be absolute. -} - canondir home d - | "~/" `isPrefixOf` d = return d - | "/~/" `isPrefixOf` d = return $ drop 1 d - | otherwise = relHome $ absPathFrom home d + where + req d mdir' = error $ unwords + [ "Only allowed to access" + , d + , maybe "and could not determine directory from command line" ("not " ++) mdir' + ] + + {- A directory may start with ~/ or in some cases, even /~/, + - or could just be relative to home, or of course could + - be absolute. -} + canondir home d + | "~/" `isPrefixOf` d = return d + | "/~/" `isPrefixOf` d = return $ drop 1 d + | otherwise = relHome $ absPathFrom home d checkEnv :: String -> IO () checkEnv var = do |