Skip to content

Commit

Permalink
New plugin: Explain Shell
Browse files Browse the repository at this point in the history
  • Loading branch information
tinogomes committed Oct 2, 2013
1 parent 17c3708 commit 43dcef1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/explainshell/explainshell.plugin.zsh
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 43dcef1

Please sign in to comment.