diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-26 20:30:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-26 20:30:07 -0400 |
commit | c30d38e108ade7eb4fa57552631b64dd3b9582c4 (patch) | |
tree | 4afc2ae95f1dbebe2d9a7dd4b177fb64fa3b8273 | |
parent | 3cb5cb6bf6f03ad3ef574a14ed35275916ac44b3 (diff) |
better warnings display
-rw-r--r-- | CmdLine.hs | 1 | ||||
-rw-r--r-- | Messages.hs | 15 | ||||
-rw-r--r-- | debian/changelog | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/CmdLine.hs b/CmdLine.hs index 1b5daadeb..76402a821 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -70,7 +70,6 @@ usage header cmds options = cmdparams c ++ pad (longest cmdparams + 2) (cmdparams c) ++ cmddesc c - indent l = " " ++ l pad n s = replicate (n - length s) ' ' longest f = foldl max 0 $ map (length . f) cmds diff --git a/Messages.hs b/Messages.hs index 2b9862230..6f4ec1e62 100644 --- a/Messages.hs +++ b/Messages.hs @@ -37,9 +37,8 @@ showProgress :: Annex () showProgress = verbose $ liftIO $ putStr "\n" showLongNote :: String -> Annex () -showLongNote s = verbose $ liftIO $ putStr $ "\n" ++ indented - where - indented = join "\n" $ map (\l -> " " ++ l) $ lines s +showLongNote s = verbose $ liftIO $ putStr $ "\n" ++ indent s + showEndOk :: Annex () showEndOk = verbose $ liftIO $ putStrLn "ok" @@ -48,9 +47,13 @@ showEndFail = verbose $ liftIO $ putStrLn "\nfailed" {- Exception pretty-printing. -} showErr :: (Show a) => a -> Annex () -showErr e = warning $ show e +showErr e = warning $ "git-annex: " ++ show e warning :: String -> Annex () -warning s = do +warning w = do verbose $ liftIO $ putStr "\n" - liftIO $ hPutStrLn stderr $ "git-annex: " ++ s ++ " " + liftIO $ hFlush stdout + liftIO $ hPutStrLn stderr $ indent w + +indent :: String -> String +indent s = join "\n" $ map (\l -> " " ++ l) $ lines s diff --git a/debian/changelog b/debian/changelog index c675d1456..92b21173c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,7 @@ git-annex (0.19) UNRELEASED; urgency=low * untrust: Now marks the current repository as untrusted. * semitrust: Now restores the default trust level. (What untrust used to do.) * fsck, drop: Take untrusted repositories into account. - * bugfix: Files were copied from trusted remotes first even if their + * Bugfix: Files were copied from trusted remotes first even if their annex.cost was higher than other remotes. -- Joey Hess <joeyh@debian.org> Wed, 19 Jan 2011 18:07:51 -0400 |