mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-17 09:26:08 +00:00
20ed43983b
Having a clear namespace `omf.` improves the readability of the code as we clarify what is the function name and what is the namespace.
15 lines
392 B
Fish
15 lines
392 B
Fish
function omf.util_valid_package -a package
|
|
test (echo "$package" | tr "[:upper:]" "[:lower:]") = "omf"; and return 10
|
|
switch $package
|
|
case {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}\*
|
|
switch $package
|
|
case "*/*" "* *" "*&*" "*\"*" "*!*" "*&*" "*%*" "*#*"
|
|
return 10
|
|
case "*"
|
|
return 0
|
|
end
|
|
case "*"
|
|
return 10
|
|
end
|
|
end
|