]> arthur.barton.de Git - ax-zsh.git/blob - default_plugins/cheat/cheat.zshrc
c36603211360ae272921f2ecaa443619eaeaedb2
[ax-zsh.git] / default_plugins / cheat / cheat.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # cheat: Setup http://cheat.sh
3
4 function cheat() {
5         url="http://cheat.sh/$@?style=monokai"
6
7         if (( $+commands[curl] )); then
8                 curl "$url"
9         elif (( $+commands[wget] )); then
10                 wget -qO - "$url"
11         else
12                 echo "Neither curl(1) nor wget(1) found!" >&2
13                 return 1
14         fi
15 }