Change flag semantics: match prefix by default
New variants summarize-any, skip-any, yield-any to match anywhere in the input linesmaster
parent
d8fa897a70
commit
26ae1fc40d
|
@ -473,10 +473,30 @@ main = B.mainFromCmdParser $ do
|
||||||
conflateStdout <- B.addSimpleBoolFlag "" ["conflate-out"] mempty
|
conflateStdout <- B.addSimpleBoolFlag "" ["conflate-out"] mempty
|
||||||
conflateStderr <- B.addSimpleBoolFlag "" ["conflate-err"] mempty
|
conflateStderr <- B.addSimpleBoolFlag "" ["conflate-err"] mempty
|
||||||
conflateBoth <- B.addSimpleBoolFlag "" ["conflate"] mempty
|
conflateBoth <- B.addSimpleBoolFlag "" ["conflate"] mempty
|
||||||
summarize <- B.addFlagStringParams "s" ["summarize"] "PATTERN" mempty
|
summarize <- B.addFlagStringParams
|
||||||
skip <- B.addFlagStringParams "x" ["skip"] "PATTERN" mempty
|
"s"
|
||||||
|
["summarize"]
|
||||||
|
"REGEX"
|
||||||
|
(B.flagHelpStr "bundle lines starting with this pattern into one line")
|
||||||
|
summarizeFull <- B.addFlagStringParams
|
||||||
|
""
|
||||||
|
["summarize-any"]
|
||||||
|
"REGEX"
|
||||||
|
(B.flagHelpStr "bundle lines containing this pattern into one line")
|
||||||
|
skip <- B.addFlagStringParams
|
||||||
|
"x"
|
||||||
|
["skip"]
|
||||||
|
"REGEX"
|
||||||
|
(B.flagHelpStr "drop lines starting with this pattern, similar to `grep -v`"
|
||||||
|
)
|
||||||
|
skipFull <- B.addFlagStringParams
|
||||||
|
""
|
||||||
|
["skip-any"]
|
||||||
|
"REGEX"
|
||||||
|
(B.flagHelpStr "drop lines containing this pattern, similar to `grep -v`")
|
||||||
label <- B.addFlagStringParams "" ["label"] "STRING" mempty
|
label <- B.addFlagStringParams "" ["label"] "STRING" mempty
|
||||||
yield <- B.addFlagStringParams "y" ["yield"] "PATTERN" mempty
|
yield <- B.addFlagStringParams "y" ["yield"] "REGEX" mempty
|
||||||
|
yieldFull <- B.addFlagStringParams "" ["yield-any"] "REGEX" mempty
|
||||||
omitSummary <- B.addSimpleBoolFlag "" ["omit-summary"] mempty
|
omitSummary <- B.addSimpleBoolFlag "" ["omit-summary"] mempty
|
||||||
tee <- B.addFlagStringParams
|
tee <- B.addFlagStringParams
|
||||||
""
|
""
|
||||||
|
@ -575,9 +595,12 @@ main = B.mainFromCmdParser $ do
|
||||||
compiled_summarize <-
|
compiled_summarize <-
|
||||||
sequence
|
sequence
|
||||||
$ join
|
$ join
|
||||||
$ [ yield <&> compiler JoinYield
|
$ [ yield <&> compiler JoinYield . (\x -> "^(" ++ x ++ ")")
|
||||||
, summarize <&> compiler JoinSpecific
|
, yieldFull <&> compiler JoinYield
|
||||||
, skip <&> compiler JoinAll
|
, summarize <&> compiler JoinSpecific . (\x -> "^(" ++ x ++ ")")
|
||||||
|
, summarizeFull <&> compiler JoinSpecific
|
||||||
|
, skip <&> compiler JoinAll . (\x -> "^(" ++ x ++ ")")
|
||||||
|
, skipFull <&> compiler JoinAll
|
||||||
]
|
]
|
||||||
(lastLine, ecMay) <- displayConsoleRegions $ do
|
(lastLine, ecMay) <- displayConsoleRegions $ do
|
||||||
initialState <- do
|
initialState <- do
|
||||||
|
|
Loading…
Reference in New Issue