Re:Explain Shell
by tmerr on Wednesday March 29, 2017 @07:00PM
(#13991402)
This works well, but the web interface seems like an unnecessary layer on top of what could just be a terminal based tool. I'm trying to resist the urge to fork this, putting another project on my todo list I will never finish
[ Parent
| on HN ]
Re:Explain Shell
by tomjakubowski on Wednesday March 29, 2017 @07:33PM
(#13991610)
The lines connecting each explanation to the relevant part of the command line could be tricky to squeeze into a terminal window. You'd could instead create an interface with a movable "cursor", which highlights a single "chunk" of the command line, and presents the explanation for that "chunk" beneath the entire command line string.
Re:Explain Shell
by LostCharacter on Thursday March 30, 2017 @08:58AM
(#13994923)
I have a little bash script I picked up somewhere that uses mankier.com to a similar effect:
explain () {
if [ "$#" -eq 0 ]
then
while read -p "Command: " cmd
do
curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd"
done
echo "Bye!"
elif [ "$#" -eq 1 ]
then
curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1"
else
echo "Usage"
echo "explain interactive mode."
echo "explain 'cmd -o | ...' one quoted command to explain it."
fi
}