oh-my-fish/pkg/omf/functions/packages/omf.packages.valid_name.fish
Derek Stavis 49dda5c2f7 Reorganize omf plugin structure
This updates omf plugin to new architecture, moving
functions to `functions` directory. It also revamps the
separation of concerns between CLI and underlying
implementations, organizing them into directories,
whose are autoloaded in plugin startup.
2016-01-09 18:59:54 -02:00

16 lines
474 B
Fish

function omf.packages.valid_name -a package
test (echo "$package" | tr "[:upper:]" "[:lower:]") = "omf"; and return 10
test (echo "$package" | tr "[:upper:]" "[:lower:]") = "default"; 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