avoid showing json lists of remotes when not in json mode
This commit is contained in:
parent
cb5dacfd40
commit
d1dd40c49b
3 changed files with 15 additions and 6 deletions
|
@ -19,12 +19,14 @@ module Messages (
|
|||
showErr,
|
||||
warning,
|
||||
indent,
|
||||
maybeShowJSON,
|
||||
setupConsole
|
||||
) where
|
||||
|
||||
import Control.Monad.State (liftIO)
|
||||
import System.IO
|
||||
import Data.String.Utils
|
||||
import Text.JSON
|
||||
|
||||
import Types
|
||||
import qualified Annex
|
||||
|
@ -106,5 +108,9 @@ handle json normal = do
|
|||
Annex.QuietOutput -> q
|
||||
Annex.JSONOutput -> liftIO json
|
||||
|
||||
{- Shows a JSON value only when in json mode. -}
|
||||
maybeShowJSON :: JSON a => [(String, a)] -> Annex ()
|
||||
maybeShowJSON v = handle (JSON.add v) q
|
||||
|
||||
q :: Monad m => m ()
|
||||
q = return ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue