New plugin: Explain Shell

This commit is contained in:
tinogomes 2013-10-02 15:55:57 -03:00
commit 9a60f1b8ec

View file

@ -0,0 +1,17 @@
function explain {
# base url with first command already injected
# $ explain tar
# => http://explainshel.com/explain/tar?args=
url="http://explainshell.com/explain/$1?args="
# removes $1 (tar) from arguments ($@)
shift;
# iterates over remaining args and adds builds the rest of the url
for i in "$@"; do
url=$url"$i""+"
done
# opens url in browser
open $url
}