Skip to content

Instantly share code, notes, and snippets.

@alexpearce
Created March 11, 2013 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexpearce/5134687 to your computer and use it in GitHub Desktop.
Save alexpearce/5134687 to your computer and use it in GitHub Desktop.
RootDocs is a tiny bash script for launching documentation for ROOT classes.
#!/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
@alexpearce
Copy link
Author

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, run rootdocs.sh TTree. An alias, such as alias rd="rootdocs.sh", is handy.

@bennygit
Copy link

bennygit commented Jul 6, 2013

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