diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-09-09 12:57:42 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-09-09 12:57:42 -0400 |
commit | cac7297784a4eb953f0d6108d7e67e97be9285ad (patch) | |
tree | ca0098b875209945e15de2f63f52463487eb5e43 /Types | |
parent | 70ad04b5fc21d39bdae85b08ec948359a28021e6 (diff) |
disentangle concurrency and message type
This makes -Jn work with --json and --quiet, where before
setting -Jn disabled those options.
Concurrent json output is currently a mess though since threads output
chunks over top of one-another.
Diffstat (limited to 'Types')
-rw-r--r-- | Types/Concurrency.hs | 8 | ||||
-rw-r--r-- | Types/Messages.hs | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Types/Concurrency.hs b/Types/Concurrency.hs new file mode 100644 index 000000000..7fe5847d7 --- /dev/null +++ b/Types/Concurrency.hs @@ -0,0 +1,8 @@ +{- Copyright 2016 Joey Hess <id@joeyh.name> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Types.Concurrency where + +data Concurrency = NonConcurrent | Concurrent Int diff --git a/Types/Messages.hs b/Types/Messages.hs index 20c8051a0..597948426 100644 --- a/Types/Messages.hs +++ b/Types/Messages.hs @@ -15,7 +15,7 @@ import Data.Default import System.Console.Regions (ConsoleRegion) #endif -data OutputType = NormalOutput | QuietOutput | ConcurrentOutput Int Bool | JSONOutput +data OutputType = NormalOutput | QuietOutput | JSONOutput deriving (Show) data SideActionBlock = NoBlock | StartBlock | InBlock @@ -23,6 +23,7 @@ data SideActionBlock = NoBlock | StartBlock | InBlock data MessageState = MessageState { outputType :: OutputType + , concurrentOutputEnabled :: Bool , sideActionBlock :: SideActionBlock , implicitMessages :: Bool #ifdef WITH_CONCURRENTOUTPUT @@ -35,6 +36,7 @@ instance Default MessageState where def = MessageState { outputType = NormalOutput + , concurrentOutputEnabled = False , sideActionBlock = NoBlock , implicitMessages = True #ifdef WITH_CONCURRENTOUTPUT |