3 ms·
For those like me who want to call it from their zsh, add the following to your .zshrc: explain(){ curl -s $(echo "http://explainshell.com/explain/$1?args=${@:
by ekyo777 13y ago
For those like me who want to call it from their zsh, add the following to your .zshrc:
explain(){ curl -s $(echo "http://explainshell.com/explain/$1?args=${@:2}" http://explainshell.com/explain/$1?args=${@:2}" | sed -e 's/ /+/g') |
sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]>//g' | sed -e 's/^ //g;s/ *$//g' | grep '.' | cat }
and call it, for example like:
explain git status -s
- idank 13y agoHa, cute! I'll add an API soon enough to return some JSON, so command line tools could wrap it more conveniently.
- connerbryan 13y agoPerhaps I'm missing something, but this doesn't work for me: % explain git status -s explain:1: no such file or directory: http://explainshell.com/explain/git?args=status http://explainshell.com/explain/git?args=status curl: no URL specified! sed: -e expression #1, char 11: unterminated `s' command
- ekyo777 13y agoIt's probably hn's formatting. I just tried copy/pasting from my post and I get the same error. Try copying it from there: https://gist.github.com/ekyo/6383547 https://gist.github.com/ekyo/6383547 I can't edit my previous post anymore, if someone can maybe add something like "EDIT: copy/paste friendly version https://gist.github.com/ekyo/6383547" https://gist.github.com/ekyo/6383547" or better, fix the formatting so it works...