Created
October 26, 2013 18:12
-
-
Save walesmd/7172724 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
function 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get an error when I try to use this.
Couldn't get a file descriptor referring to the console
Do I need to install the "open" command?