mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-12 16:13:19 -07:00
Adds support for a SHELLCHECK_OPTS environment variable.
This commit is contained in:
parent
d0029ae1d4
commit
ae4aea4530
3 changed files with 25 additions and 1 deletions
|
@ -71,3 +71,10 @@ subRegex re input replacement = f input
|
|||
(before, match, after) <- matchM re str :: Maybe (String, String, String)
|
||||
when (null match) $ error ("Internal error: substituted empty in " ++ str)
|
||||
return $ before ++ replacement ++ f after
|
||||
|
||||
-- Split a string based on a regex.
|
||||
splitOn :: String -> Regex -> [String]
|
||||
splitOn input re =
|
||||
case matchM re input :: Maybe (String, String, String) of
|
||||
Just (before, match, after) -> before : after `splitOn` re
|
||||
Nothing -> [input]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue