make noMessages disable closing of json object in --json mode
This allows things like Command.Find to use noMessages and generate their own complete json objects. Previouly, Command.Find managed that only via a hack, which wasn't compatable with batch mode. Only Command.Find, Command.Smudge, and Commange.Status use noMessages currently, and none except for Command.Find are impacted by this change. Fixes find --json --batch output
This commit is contained in:
parent
7aac76d40e
commit
70b8cad9c8
7 changed files with 26 additions and 11 deletions
|
@ -36,6 +36,7 @@ module Messages (
|
|||
debugEnabled,
|
||||
commandProgressDisabled,
|
||||
outputMessage,
|
||||
implicitMessage,
|
||||
) where
|
||||
|
||||
import Text.JSON
|
||||
|
@ -212,3 +213,9 @@ commandProgressDisabled = withOutputType $ \t -> return $ case t of
|
|||
JSONOutput -> True
|
||||
NormalOutput -> False
|
||||
ConcurrentOutput _ -> True
|
||||
|
||||
{- Use to show a message that is displayed implicitly, and so might be
|
||||
- disabled when running a certian command that needs more control over its
|
||||
- output. -}
|
||||
implicitMessage :: Annex () -> Annex ()
|
||||
implicitMessage = whenM (implicitMessages <$> Annex.getState Annex.output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue