mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 13:31:36 -07:00
Getting command name from busybox now gets applet name
This commit is contained in:
parent
46fb91b44d
commit
35c74e4747
2 changed files with 14 additions and 6 deletions
|
@ -240,8 +240,15 @@ getCommand t =
|
|||
|
||||
-- Maybe get the command name of a token representing a command
|
||||
getCommandName t = do
|
||||
(T_SimpleCommand _ _ (w:_)) <- getCommand t
|
||||
getLiteralString w
|
||||
(T_SimpleCommand _ _ (w:rest)) <- getCommand t
|
||||
s <- getLiteralString w
|
||||
if "busybox" `isSuffixOf` s
|
||||
then
|
||||
case rest of
|
||||
(applet:_) -> getLiteralString applet
|
||||
_ -> return s
|
||||
else
|
||||
return s
|
||||
|
||||
-- If a command substitution is a single command, get its name.
|
||||
-- $(date +%s) = Just "date"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue