better warnings display
This commit is contained in:
parent
3cb5cb6bf6
commit
c30d38e108
3 changed files with 10 additions and 8 deletions
|
@ -70,7 +70,6 @@ usage header cmds options =
|
||||||
cmdparams c ++
|
cmdparams c ++
|
||||||
pad (longest cmdparams + 2) (cmdparams c) ++
|
pad (longest cmdparams + 2) (cmdparams c) ++
|
||||||
cmddesc c
|
cmddesc c
|
||||||
indent l = " " ++ l
|
|
||||||
pad n s = replicate (n - length s) ' '
|
pad n s = replicate (n - length s) ' '
|
||||||
longest f = foldl max 0 $ map (length . f) cmds
|
longest f = foldl max 0 $ map (length . f) cmds
|
||||||
|
|
||||||
|
|
15
Messages.hs
15
Messages.hs
|
@ -37,9 +37,8 @@ showProgress :: Annex ()
|
||||||
showProgress = verbose $ liftIO $ putStr "\n"
|
showProgress = verbose $ liftIO $ putStr "\n"
|
||||||
|
|
||||||
showLongNote :: String -> Annex ()
|
showLongNote :: String -> Annex ()
|
||||||
showLongNote s = verbose $ liftIO $ putStr $ "\n" ++ indented
|
showLongNote s = verbose $ liftIO $ putStr $ "\n" ++ indent s
|
||||||
where
|
|
||||||
indented = join "\n" $ map (\l -> " " ++ l) $ lines s
|
|
||||||
showEndOk :: Annex ()
|
showEndOk :: Annex ()
|
||||||
showEndOk = verbose $ liftIO $ putStrLn "ok"
|
showEndOk = verbose $ liftIO $ putStrLn "ok"
|
||||||
|
|
||||||
|
@ -48,9 +47,13 @@ showEndFail = verbose $ liftIO $ putStrLn "\nfailed"
|
||||||
|
|
||||||
{- Exception pretty-printing. -}
|
{- Exception pretty-printing. -}
|
||||||
showErr :: (Show a) => a -> Annex ()
|
showErr :: (Show a) => a -> Annex ()
|
||||||
showErr e = warning $ show e
|
showErr e = warning $ "git-annex: " ++ show e
|
||||||
|
|
||||||
warning :: String -> Annex ()
|
warning :: String -> Annex ()
|
||||||
warning s = do
|
warning w = do
|
||||||
verbose $ liftIO $ putStr "\n"
|
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
2
debian/changelog
vendored
|
@ -6,7 +6,7 @@ git-annex (0.19) UNRELEASED; urgency=low
|
||||||
* untrust: Now marks the current repository as untrusted.
|
* untrust: Now marks the current repository as untrusted.
|
||||||
* semitrust: Now restores the default trust level. (What untrust used to do.)
|
* semitrust: Now restores the default trust level. (What untrust used to do.)
|
||||||
* fsck, drop: Take untrusted repositories into account.
|
* 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.
|
annex.cost was higher than other remotes.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Wed, 19 Jan 2011 18:07:51 -0400
|
-- Joey Hess <joeyh@debian.org> Wed, 19 Jan 2011 18:07:51 -0400
|
||||||
|
|
Loading…
Reference in a new issue