hxbrief: Add flag "--omitSummary" to omit summary before exit
parent
7ff33187c8
commit
7e97c65716
|
@ -21,6 +21,7 @@ import Control.Exception ( AsyncException(UserInterrupt)
|
||||||
import Control.Monad ( forM_
|
import Control.Monad ( forM_
|
||||||
, forever
|
, forever
|
||||||
, replicateM
|
, replicateM
|
||||||
|
, unless
|
||||||
, when
|
, when
|
||||||
, zipWithM_
|
, zipWithM_
|
||||||
)
|
)
|
||||||
|
@ -419,6 +420,7 @@ main = B.mainFromCmdParser $ do
|
||||||
conflateBoth <- B.addSimpleBoolFlag "" ["conflate"] mempty
|
conflateBoth <- B.addSimpleBoolFlag "" ["conflate"] mempty
|
||||||
summarize <- B.addFlagStringParams "s" ["summarize"] "PATTERN" mempty
|
summarize <- B.addFlagStringParams "s" ["summarize"] "PATTERN" mempty
|
||||||
skip <- B.addFlagStringParams "x" ["skip"] "PATTERN" mempty
|
skip <- B.addFlagStringParams "x" ["skip"] "PATTERN" mempty
|
||||||
|
omitSummary <- B.addSimpleBoolFlag "" ["omit-summary"] mempty
|
||||||
-- section <- B.addSimpleBoolFlag "" ["section"] mempty
|
-- section <- B.addSimpleBoolFlag "" ["section"] mempty
|
||||||
B.reorderStop
|
B.reorderStop
|
||||||
rest <- B.addParamRestOfInputRaw "COMMAND" mempty <&> \case
|
rest <- B.addParamRestOfInputRaw "COMMAND" mempty <&> \case
|
||||||
|
@ -579,7 +581,7 @@ main = B.mainFromCmdParser $ do
|
||||||
pure (lastLine, ecMay)
|
pure (lastLine, ecMay)
|
||||||
|
|
||||||
flushConcurrentOutput
|
flushConcurrentOutput
|
||||||
outputConcurrent lastLine
|
unless omitSummary $ outputConcurrent lastLine
|
||||||
case ecMay of
|
case ecMay of
|
||||||
Nothing -> throwIO UserInterrupt -- essentially re-throw
|
Nothing -> throwIO UserInterrupt -- essentially re-throw
|
||||||
Just ec -> exitWith ec
|
Just ec -> exitWith ec
|
||||||
|
|
Loading…
Reference in New Issue