You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hdocs 460B

1234567891011121314151617181920
  1. #!/bin/sh
  2. #
  3. # pbrisbin 2014 - browse local haskell documentation.
  4. #
  5. ###
  6. if [ -z "$1" ]; then
  7. printf "usage: hdocs <identifier>\n"
  8. exit 64
  9. fi
  10. package="$(printf "%s" "$*" | sed 's/[ .]/-/g; s/.*/\L&/g')"
  11. package_glob="*/$package-*/html/index.html"
  12. if [ -e "$PWD/.cabal-sandbox" ]; then
  13. docs_directory="$PWD/.cabal-sandbox/share/doc"
  14. else
  15. docs_directory="$HOME/.cabal/share/doc"
  16. fi
  17. find "$docs_directory" -wholename "$package_glob" -exec $BROWSER {} +