diff options
author | Joey Hess <joey@kitenet.net> | 2014-10-09 15:35:19 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-10-09 15:46:05 -0400 |
commit | f3d197128322981d58677ba165f7d33158e07940 (patch) | |
tree | d73f043118c4b50313fc8475222df6245eac2beb /Command/NumCopies.hs | |
parent | cfc51c5e4ec04f9d5088c42922217cf90b63c903 (diff) |
hlint
Diffstat (limited to 'Command/NumCopies.hs')
-rw-r--r-- | Command/NumCopies.hs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Command/NumCopies.hs b/Command/NumCopies.hs index b7323ae35..52eb9dcc6 100644 --- a/Command/NumCopies.hs +++ b/Command/NumCopies.hs @@ -22,16 +22,15 @@ seek = withWords start start :: [String] -> CommandStart start [] = startGet -start [s] = do - case readish s of - Nothing -> error $ "Bad number: " ++ s - Just n - | n > 0 -> startSet n - | n == 0 -> ifM (Annex.getState Annex.force) - ( startSet n - , error "Setting numcopies to 0 is very unsafe. You will lose data! If you really want to do that, specify --force." - ) - | otherwise -> error "Number cannot be negative!" +start [s] = case readish s of + Nothing -> error $ "Bad number: " ++ s + Just n + | n > 0 -> startSet n + | n == 0 -> ifM (Annex.getState Annex.force) + ( startSet n + , error "Setting numcopies to 0 is very unsafe. You will lose data! If you really want to do that, specify --force." + ) + | otherwise -> error "Number cannot be negative!" start _ = error "Specify a single number." startGet :: CommandStart @@ -39,9 +38,9 @@ startGet = next $ next $ do Annex.setOutput QuietOutput v <- getGlobalNumCopies case v of - Just n -> liftIO $ putStrLn $ show $ fromNumCopies n + Just n -> liftIO $ print $ fromNumCopies n Nothing -> do - liftIO $ putStrLn $ "global numcopies is not set" + liftIO $ putStrLn "global numcopies is not set" old <- deprecatedNumCopies case old of Nothing -> liftIO $ putStrLn "(default is 1)" |