feat(SC2232): add more shell builtins

This commit is contained in:
Eisuke Kawashima 2025-07-20 07:32:04 +09:00
commit c0f1265fa0
No known key found for this signature in database
GPG key ID: AE0456361ACA5F4B

View file

@ -1244,7 +1244,7 @@ checkSudoArgs = CommandCheck (Basename "sudo") f
command <- getLiteralString commandArg
guard $ command `elem` builtins
return $ warn (getId t) 2232 $ "Can't use sudo with builtins like " ++ command ++ ". Did you want sudo sh -c .. instead?"
builtins = [ "cd", "eval", "export", "history", "read", "source", "wait" ]
builtins = [ "cd", "command", "declare", "eval", "exec", "exit", "export", "hash", "history", "local", "popd", "pushd", "read", "readonly", "return", "set", "source", "trap", "type", "typeset", "ulimit", "umask", "unset", "wait" ]
-- This mess is why ShellCheck prefers not to know.
parseOpts = getBsdOpts "vAknSbEHPa:g:h:p:u:c:T:r:"