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:
Joey Hess 2016-01-20 14:07:13 -04:00
parent 7aac76d40e
commit 70b8cad9c8
Failed to extract signature
7 changed files with 26 additions and 11 deletions

View file

@ -66,8 +66,11 @@ withParams mkseek paramdesc = mkseek <$> cmdParams paramdesc
noCommit :: Command -> Command
noCommit c = c { cmdnocommit = True }
{- Indicates that a command should not output anything other than what
- it directly sends to stdout. (--json can override this). -}
{- Indicates that a command should not output the usual messages when
- starting or stopping processing a file or other item. Unless --json mode
- is enabled, this also enables quiet output mode, so only things
- explicitly output by the command are shown and not progress messages
- etc. -}
noMessages :: Command -> Command
noMessages c = c { cmdnomessages = True }