mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-13 16:43:20 -07:00
Sanity check command names (fixes #2227)
This commit is contained in:
parent
331e89be99
commit
163b2f12e2
3 changed files with 44 additions and 0 deletions
|
@ -877,6 +877,10 @@ getBracedModifier s = headOrDefault "" $ do
|
|||
headOrDefault _ (a:_) = a
|
||||
headOrDefault def _ = def
|
||||
|
||||
-- Get the last element or a default. Like `last` but safe.
|
||||
lastOrDefault def [] = def
|
||||
lastOrDefault _ list = last list
|
||||
|
||||
--- Get element n of a list, or Nothing. Like `!!` but safe.
|
||||
(!!!) list i =
|
||||
case drop i list of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue