Check type flags under dash and POSIX sh (fixes #1471)
There are no flags for the type builtin defined under POSIX sh, nor does dash define any. Bash, however, allows [-aftpP]. We check this now under POSIX and dash.
This commit is contained in:
parent
a621eba6d3
commit
63a259e5be
|
@ -150,6 +150,8 @@ prop_checkBashisms67 = verify checkBashisms "#!/bin/sh\ncd -P -e ."
|
||||||
prop_checkBashisms68 = verify checkBashisms "#!/bin/sh\numask -p"
|
prop_checkBashisms68 = verify checkBashisms "#!/bin/sh\numask -p"
|
||||||
prop_checkBashisms69 = verifyNot checkBashisms "#!/bin/sh\numask -S"
|
prop_checkBashisms69 = verifyNot checkBashisms "#!/bin/sh\numask -S"
|
||||||
prop_checkBashisms70 = verify checkBashisms "#!/bin/sh\ntrap -l"
|
prop_checkBashisms70 = verify checkBashisms "#!/bin/sh\ntrap -l"
|
||||||
|
prop_checkBashisms71 = verify checkBashisms "#!/bin/sh\ntype -a ls"
|
||||||
|
prop_checkBashisms72 = verifyNot checkBashisms "#!/bin/sh\ntype ls"
|
||||||
checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
||||||
params <- ask
|
params <- ask
|
||||||
kludge params t
|
kludge params t
|
||||||
|
@ -302,6 +304,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
||||||
("read", Just $ if isDash then ["r", "p"] else ["r"]),
|
("read", Just $ if isDash then ["r", "p"] else ["r"]),
|
||||||
("readonly", Just ["p"]),
|
("readonly", Just ["p"]),
|
||||||
("trap", Just []),
|
("trap", Just []),
|
||||||
|
("type", Just []),
|
||||||
("ulimit", if isDash then Nothing else Just ["f"]),
|
("ulimit", if isDash then Nothing else Just ["f"]),
|
||||||
("umask", Just ["S"])
|
("umask", Just ["S"])
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue