Created
March 11, 2013 14:37
-
-
Save alexpearce/5134687 to your computer and use it in GitHub Desktop.
RootDocs is a tiny bash script for launching documentation for ROOT classes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function bail { | |
echo You did not enter a valid ROOT class $1 | |
exit 1 | |
} | |
if [ -n "$1" ]; then | |
if [ `expr match $1 T` == 1 ]; then | |
status_code=`curl -o /dev/null -sIw "%{http_code}" http://root.cern.ch/root/html/$1.html` | |
if [ $status_code == 200 ]; then | |
firefox http://root.cern.ch/root/html/$1.html | |
else bail \(404\) | |
fi | |
else bail | |
fi | |
else bail | |
fi | |
unset status_code |
Thank you very much! I love that gist!
If anyone would like to use it with his favorite browser to open the URL, you can try to change "firefox" to "xdg-open".
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RootDocs is a tiny bash script for launching documentation for ROOT classes. To install it, place it somewhere in your PATH and
chmod +x rootdocs.sh
. To use it, runrootdocs.sh TTree
. An alias, such asalias rd="rootdocs.sh"
, is handy.