better warnings display

This commit is contained in:
Joey Hess 2011-01-26 20:30:07 -04:00
parent 3cb5cb6bf6
commit c30d38e108
3 changed files with 10 additions and 8 deletions

View file

@ -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

View file

@ -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

2
debian/changelog vendored
View file

@ -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