mirror of
				https://github.com/koalaman/shellcheck.git
				synced 2025-10-31 06:29:20 +08:00 
			
		
		
		
	Simplify isArrayFlag
This commit is contained in:
		| @@ -669,12 +669,10 @@ getModifiedVariableCommand base@(T_SimpleCommand id cmdPrefix (T_NormalWord _ (T | |||||||
|         map (getLiteralArray . snd) |         map (getLiteralArray . snd) | ||||||
|             (filter (isArrayFlag . fst) (zip args (tail args))) |             (filter (isArrayFlag . fst) (zip args (tail args))) | ||||||
|  |  | ||||||
|     isArrayFlag x = fromMaybe False $ do |     isArrayFlag x = case getLiteralString x of | ||||||
|         str <- getLiteralString x |                        Just ('-':'-':_) -> False | ||||||
|         return $ case str of |                        Just ('-':str) -> 'a' `elem` str | ||||||
|                     '-':'-':_ -> False |                        _ -> False | ||||||
|                     '-':str -> 'a' `elem` str |  | ||||||
|                     _ -> False |  | ||||||
|  |  | ||||||
|     -- get the FLAGS_ variable created by a shflags DEFINE_ call |     -- get the FLAGS_ variable created by a shflags DEFINE_ call | ||||||
|     getFlagVariable (n:v:_) = do |     getFlagVariable (n:v:_) = do | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user