arrange for regional output manager to run when -J is enabled

Commands that want to use it have to run their seek action inside
allowConcurrentOutput. Which seems reasonable; perhaps some future command
will want to support the -J flag but not use regions.

The region state moved from Annex to MessageState. This makes sense
organizationally, and note that some uses of onLocal use a different Annex
state, but pass the MessageState into it, which is what is needed.
This commit is contained in:
Joey Hess 2015-11-04 16:19:00 -04:00
parent a4dd8503b8
commit c0c595345c
Failed to extract signature
12 changed files with 58 additions and 50 deletions

View file

@ -5,11 +5,18 @@
- Licensed under the GNU GPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Types.Messages where
import Data.Default
#ifdef WITH_CONCURRENTOUTPUT
import System.Console.Regions (ConsoleRegion)
#endif
data OutputType = NormalOutput | QuietOutput | ConcurrentOutput Int | JSONOutput
deriving (Show)
data SideActionBlock = NoBlock | StartBlock | InBlock
deriving (Eq)
@ -17,8 +24,10 @@ data SideActionBlock = NoBlock | StartBlock | InBlock
data MessageState = MessageState
{ outputType :: OutputType
, sideActionBlock :: SideActionBlock
, consoleRegion :: Maybe ConsoleRegion
, consoleRegionErrFlag :: Bool
}
instance Default MessageState
where
def = MessageState NormalOutput NoBlock
def = MessageState NormalOutput NoBlock Nothing False