mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
New plugin: Explain Shell
This commit is contained in:
parent
17c3708dd1
commit
43dcef1b07
1 changed files with 17 additions and 0 deletions
17
plugins/explainshell/explainshell.plugin.zsh
Normal file
17
plugins/explainshell/explainshell.plugin.zsh
Normal 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
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue