mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-08 05:51:09 -07:00
Simplify isArrayFlag
This commit is contained in:
parent
e4eb2d157f
commit
2ebf522a52
1 changed files with 4 additions and 6 deletions
|
@ -669,12 +669,10 @@ getModifiedVariableCommand base@(T_SimpleCommand id cmdPrefix (T_NormalWord _ (T
|
|||
map (getLiteralArray . snd)
|
||||
(filter (isArrayFlag . fst) (zip args (tail args)))
|
||||
|
||||
isArrayFlag x = fromMaybe False $ do
|
||||
str <- getLiteralString x
|
||||
return $ case str of
|
||||
'-':'-':_ -> False
|
||||
'-':str -> 'a' `elem` str
|
||||
_ -> False
|
||||
isArrayFlag x = case getLiteralString x of
|
||||
Just ('-':'-':_) -> False
|
||||
Just ('-':str) -> 'a' `elem` str
|
||||
_ -> False
|
||||
|
||||
-- get the FLAGS_ variable created by a shflags DEFINE_ call
|
||||
getFlagVariable (n:v:_) = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue