summaryrefslogtreecommitdiff
path: root/Commands.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-22 20:47:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-22 20:47:14 -0400
commitf4e2dde8a8ceaf689ec5391174b53cb1b213ea8b (patch)
treea2865cce91287fa8fcb1aedba1c3759245bb9823 /Commands.hs
parentff38e49eb453ccfd58ce0e424aeca97389ab0100 (diff)
fix perl refugee code
Diffstat (limited to 'Commands.hs')
-rw-r--r--Commands.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Commands.hs b/Commands.hs
index 3e7447c5b..cb923d5e5 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -117,9 +117,9 @@ findWanted Description params _ = do
parseCmd :: [String] -> AnnexState -> IO ([Annex ()], [Annex ()])
parseCmd argv state = do
(flags, params) <- getopt
- case (length params) of
- 0 -> error usage
- _ -> case (lookupCmd (params !! 0)) of
+ if (null params)
+ then error usage
+ else case (lookupCmd (params !! 0)) of
[] -> error usage
[Command _ action want _] -> do
f <- findWanted want (drop 1 params)
@@ -258,7 +258,7 @@ fixCmd file = inBackend file $ \(key, backend) -> do
{- Stores description for the repository. -}
initCmd :: String -> Annex ()
initCmd description = do
- if (0 == length description)
+ if (null description)
then error $
"please specify a description of this repository\n" ++
usage
@@ -275,7 +275,7 @@ initCmd description = do
fromKeyCmd :: FilePath -> Annex ()
fromKeyCmd file = do
keyname <- Annex.flagGet "key"
- if (0 == length keyname)
+ if (null keyname)
then error "please specify the key with --key"
else return ()
backends <- Backend.list