mirror of
				https://github.com/koalaman/shellcheck.git
				synced 2025-11-04 09:26:10 +08:00 
			
		
		
		
	Simplify isUnquotedFlag
This commit is contained in:
		@@ -158,9 +158,10 @@ isFlag token =
 | 
			
		||||
        _ -> False
 | 
			
		||||
 | 
			
		||||
-- Is this token a flag where the - is unquoted?
 | 
			
		||||
isUnquotedFlag token = fromMaybe False $ do
 | 
			
		||||
    str <- getLeadingUnquotedString token
 | 
			
		||||
    return $ "-" `isPrefixOf` str
 | 
			
		||||
isUnquotedFlag token =
 | 
			
		||||
    case getLeadingUnquotedString token of
 | 
			
		||||
        Just ('-':_) -> True
 | 
			
		||||
        _ -> False
 | 
			
		||||
 | 
			
		||||
-- getGnuOpts "erd:u:" will parse a list of arguments tokens like `read`
 | 
			
		||||
--     -re -d : -u 3 bar
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user