This commit is contained in:
Michael Wales 2018-04-17 21:10:57 +00:00 committed by GitHub
commit 7e8dfed7cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,23 @@
# CanIUse.com Command Line Search Utility
# Michael Wales, http://github.com/walesmd
#
# A very basic bash function that quickly searches http://caniuse.com/
#
# Examples:
# caniuse
# caniuse border-radius
# caniuse "alpha transparency" counters "canvas drawings" html svg
caniuse() {
local domain="http://caniuse.com/"
local query
if [ $# -eq 0 ]; then
open ${domain}
else
for term in "$@"; do
query=$(python -c "import sys, urllib as ul; print ul.quote('${term}');")
open "${domain}#search=${query}"
done
fi
}